Dynomotion

Group: DynoMotion Message: 13475 From: mtr505 Date: 7/6/2016
Subject: z-touch glitch?
Hello,

I'm learning how to use the z-touch for my K2cnc and there seems to be a glitch.

It doesn't seem to switch between mm and inchs automatically. What I mean by this is if my part was built in mm and then I touch off on a bit, the machine runs above the intended material block. (the mm units is checked at this point)  But if I manually switch the units by checking the "inch" units in the gui then use the touch-off plate, the measurement works and cuts normally. The off-set number in the program seems to be 1.85 with no mention of units. But one can see that when you set it under mm it only off-sets it 1.85mm and when units are in inches it's off-set 1.85 inchs. The touch-off plate is about 1.85in tall when the indicator light comes on.

This is all reflected in the Edit Fixture Offset display but this too is confusing because it also does not show what units it is currently active in.

This is easy enough for me to do but I'm trying to simplify so that instructors and art students can use this machine. They will be generating their g-code from fusion360.

I wonder if the program can be altered to recognize what units the Kmotion is using.  This would help prevent user error on our end. Also, I wonder if active units can be added to the Edit Fixture Offset display?

Just a note, I'm not a cnc operator or programmer. sorry.

Thanks,
Robert
Group: DynoMotion Message: 13476 From: Tom Kerekes Date: 7/6/2016
Subject: Re: z-touch glitch?

Hi Robert,

You are correct the Fixture Tables, Tool Tables, and G92 global offsets don't have units.  The assumption is the units are the same as the Job you are going to run.

The program that probes the touch off plate could be made to query KMotionCNC to determine what the current units are and do the appropriate calculations.  However the KMotionCNC units must be set properly for the Job you are going to run before doing the touch off.

See the ToolTableSet.c for an example of how to read the current Units of KMotionCNC.

Regards

TK


On 7/6/2016 7:11 AM, robert.taormina@... [DynoMotion] wrote:
 

Hello,

I'm learning how to use the z-touch for my K2cnc and there seems to be a glitch.

It doesn't seem to switch between mm and inchs automatically. What I mean by this is if my part was built in mm and then I touch off on a bit, the machine runs above the intended material block. (the mm units is checked at this point)  But if I manually switch the units by checking the "inch" units in the gui then use the touch-off plate, the measurement works and cuts normally. The off-set number in the program seems to be 1.85 with no mention of units. But one can see that when you set it under mm it only off-sets it 1.85mm and when units are in inches it's off-set 1.85 inchs. The touch-off plate is about 1.85in tall when the indicator light comes on.

This is all reflected in the Edit Fixture Offset display but this too is confusing because it also does not show what units it is currently active in.

This is easy enough for me to do but I'm trying to simplify so that instructors and art students can use this machine. They will be generating their g-code from fusion360.

I wonder if the program can be altered to recognize what units the Kmotion is using.  This would help prevent user error on our end. Also, I wonder if active units can be added to the Edit Fixture Offset display?

Just a note, I'm not a cnc operator or programmer. sorry.

Thanks,
Robert


Group: DynoMotion Message: 13478 From: mtr505 Date: 7/6/2016
Subject: Re: z-touch glitch?
Hi Tom,

So, I found the ToolTableSet.c and K2_TouchZero.c and openned them in notebook++

I'm afraid this is above my head.  Is there something I need to change in the K2_TouchZero.c program? Like cut and past into the program from ToolTableSet.c? Is it that simple?

Or is there something I need to change in the user button tool set up screen when setting up the screen button to reference ToolTableSet.c?

Robert
Group: DynoMotion Message: 13480 From: Tom Kerekes Date: 7/6/2016
Subject: Re: z-touch glitch?

Hi Robert,

Post the K2_TouchZero.c file for us to look at.

Regards

TK


On 7/6/2016 12:03 PM, robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,

So, I found the ToolTableSet.c and K2_TouchZero.c and openned them in notebook++

I'm afraid this is above my head.  Is there something I need to change in the K2_TouchZero.c program? Like cut and past into the program from ToolTableSet.c? Is it that simple?

Or is there something I need to change in the user button tool set up screen when setting up the screen button to reference ToolTableSet.c?

Robert


Group: DynoMotion Message: 13481 From: mtr505 Date: 7/6/2016
Subject: Re: z-touch glitch?
OK, So, I'm not sure about the best way so I copied the file as an attachment as well as here.

#include "KMotionDef.h"
#include "Driver\Defines.c"

#define Z_UP_AFTER_TOUCH 1.0 //Move up this amount in Inches after tool touch
#define Offset_FromTouch 1.85 //if you don't want the dro set to zero
#define TOUCH_PROBE_PIN 17
double CountsPerInchZ;

#define GATH_OFF 0

int DoPC(int cmd);
int DoPCInt(int cmd, int i);
int MDI(char *s);
int DoPCFloat(int cmd, float f);

float saveaccel,savejerk;
double touchPos;

double offsetFromFirstTool;
double offsetFromPartZero;
float newDRO;

//-------------------------------------------------------
//-------------------------------------------------------
main()
{
    CountsPerInchZ = persist.UserData[ZSPI]; //get count

    // Save current Accel/Jerk
    saveaccel=chan[Z].Accel;
    savejerk=chan[Z].Jerk;

    // Set Accel/Jerk to Very fast
    chan[Z].Accel = 1000000000;
    chan[Z].Jerk = 1000000000;

    // Move Down
    Jog(Z,-5000);

    // Waite for Touch Probe hit
    while(ReadBit(TOUCH_PROBE_PIN))
    {
        if (CheckDone(Z))
            break;
    }
    touchPos = chan[Z].Position;    // Record position

    if (!ReadBit(ESTOP_SW)) return;

    Jog(Z, 0);
   
    // Restore saved Accel/Jerk
    chan[Z].Accel = saveaccel;
    chan[Z].Jerk = savejerk;
   
    Move(Z, touchPos);
    while(!CheckDone(Z));

    newDRO = Offset_FromTouch;
   
    //printf("%f, %f, %f\n", newDRO, offsetFromPartZero, offsetFromFirstTool);
   
    // Set New DRO Z Height
    DoPCFloat(PC_COMM_SET_Z, newDRO);

    Delay_sec(1.0);
    MoveRel(Z, Z_UP_AFTER_TOUCH * CountsPerInchZ);
}

//-------------------------------------------------------
//-------------------------------------------------------
// put the MDI string (Manual Data Input - GCode) in the
// gather buffer and tell the App where it is
int MDI(char *s)
{
    char *p=(char *)gather_buffer+GATH_OFF*sizeof(int);
    int i;
   
    do // copy to gather buffer w offset 0
    {
        *p++ = *s++;
    }while (s[-1]);
   
    // issue the command an wait till it is complete
    // (or an error - such as busy)
    return DoPCInt(PC_COMM_MDI,GATH_OFF);
}


// Put a Float as a parameter and pass the command to the App
int DoPCFloat(int cmd, float f)
{
    int result;
    persist.UserData[PC_COMM_PERSIST+1] = *(int*)&f;
    return DoPC(cmd);
}

// Put an integer as a parameter and pass the command to the App
int DoPCInt(int cmd, int i)
{
    int result;
    persist.UserData[PC_COMM_PERSIST+1] = i;
    return DoPC(cmd);
}

// Pass a command to the PC and wait for it to handshake
// that it was received by either clearing the command
// or changing it to a negative error code
int DoPC(int cmd)
{
    int result;
   
    persist.UserData[PC_COMM_PERSIST]=cmd;
   
    do
    {
        WaitNextTimeSlice();   
    }while (result=persist.UserData[PC_COMM_PERSIST]>0);
   
    return result;
}
  @@attachment@@
Group: DynoMotion Message: 13484 From: Tom Kerekes Date: 7/6/2016
Subject: Re: z-touch glitch? [1 Attachment]

Hi Robert,

The file attached ok.

But that file includes the file #include "Driver\Defines.c".  Which may possibly include others.

Please post those as well so we can compile the code.

But basically the function from our examples to read the Units needs to be included and called and then if mm mode multiply Offset_FromTouch by 25.4.

Many of those helper functions that K2CNC physically copied into the program can be all included (including the new function to check the Units) with just these two lines as shown in ToolTableSet.c.   So then remove them from the main program.

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

Then you can call:

    GetMiscSettings(&Units, &TWORD, &HWORD, &DWORD);
    if (Units==CANON_UNITS_INCHES)            // for inches
        newDRO = Offset_FromTouch;
    else  
        newDRO = Offset_FromTouch * 25.4;


HTH

Regards

TK


On 7/6/2016 12:42 PM, robert.taormina@... [DynoMotion] wrote:
 

OK, So, I'm not sure about the best way so I copied the file as an attachment as well as here.

#include "KMotionDef.h"
#include "Driver\Defines.c"

#define Z_UP_AFTER_TOUCH 1.0 //Move up this amount in Inches after tool touch
#define Offset_FromTouch 1.85 //if you don't want the dro set to zero
#define TOUCH_PROBE_PIN 17
double CountsPerInchZ;

#define GATH_OFF 0

int DoPC(int cmd);
int DoPCInt(int cmd, int i);
int MDI(char *s);
int DoPCFloat(int cmd, float f);

float saveaccel,savejerk;
double touchPos;

double offsetFromFirstTool;
double offsetFromPartZero;
float newDRO;

//-------------------------------------------------------
//-------------------------------------------------------
main()
{
    CountsPerInchZ = persist.UserData[ZSPI]; //get count

    // Save current Accel/Jerk
    saveaccel=chan[Z].Accel;
    savejerk=chan[Z].Jerk;

    // Set Accel/Jerk to Very fast
    chan[Z].Accel = 1000000000;
    chan[Z].Jerk = 1000000000;

    // Move Down
    Jog(Z,-5000);

    // Waite for Touch Probe hit
    while(ReadBit(TOUCH_PROBE_PIN))
    {
        if (CheckDone(Z))
            break;
    }
    touchPos = chan[Z].Position;    // Record position

    if (!ReadBit(ESTOP_SW)) return;

    Jog(Z, 0);
   
    // Restore saved Accel/Jerk
    chan[Z].Accel = saveaccel;
    chan[Z].Jerk = savejerk;
   
    Move(Z, touchPos);
    while(!CheckDone(Z));

    newDRO = Offset_FromTouch;
   
    //printf("%f, %f, %f\n", newDRO, offsetFromPartZero, offsetFromFirstTool);
   
    // Set New DRO Z Height
    DoPCFloat(PC_COMM_SET_Z, newDRO);

    Delay_sec(1.0);
    MoveRel(Z, Z_UP_AFTER_TOUCH * CountsPerInchZ);
}

//-------------------------------------------------------
//-------------------------------------------------------
// put the MDI string (Manual Data Input - GCode) in the
// gather buffer and tell the App where it is
int MDI(char *s)
{
    char *p=(char *)gather_buffer+GATH_OFF*sizeof(int);
    int i;
   
    do // copy to gather buffer w offset 0
    {
        *p++ = *s++;
    }while (s[-1]);
   
    // issue the command an wait till it is complete
    // (or an error - such as busy)
    return DoPCInt(PC_COMM_MDI,GATH_OFF);
}


// Put a Float as a parameter and pass the command to the App
int DoPCFloat(int cmd, float f)
{
    int result;
    persist.UserData[PC_COMM_PERSIST+1] = *(int*)&f;
    return DoPC(cmd);
}

// Put an integer as a parameter and pass the command to the App
int DoPCInt(int cmd, int i)
{
    int result;
    persist.UserData[PC_COMM_PERSIST+1] = i;
    return DoPC(cmd);
}

// Pass a command to the PC and wait for it to handshake
// that it was received by either clearing the command
// or changing it to a negative error code
int DoPC(int cmd)
{
    int result;
   
    persist.UserData[PC_COMM_PERSIST]=cmd;
   
    do
    {
        WaitNextTimeSlice();   
    }while (result=persist.UserData[PC_COMM_PERSIST]>0);
   
    return result;
}


Group: DynoMotion Message: 13491 From: mtr505 Date: 7/7/2016
Subject: Re: z-touch glitch? [1 Attachment]
Hi Tom,

I'm not sure which files to send so I will attached to folders.  One is labled KFlop_copy and the other KFlop_old_copy.  I was only able to find the tool touch file in old_copy but I think all other files are from KFlop..... As you can see our files are a bit jumbled. Someone had copied files to try to save them but it looks like some were lost or not transferred to the new KFlop when we up graded to 432.  More than one person has tried to work on this.... I tried moving the tool touch program into the KFlop with the rest of the used files but then the touch off did not work.  I will try again.

Also, here is a list of what is "visible" in the Threads. I know that you have said in the past that what you see may not be what is loaded in the Threads.  In the ConFig screen only Thread #6 is listed as launch at start-up.
Threads:
#1 - bitlog_sLimit (KFlop)
#2 - InitStepDir 3 Axis (KM 432 CPrograms)
#3 - StopCallBack (KFlop)
#4 - SetStepPulseLength (KM 432 CPrograms)
#5 - homing_XYZ (KFlop)
#6 - K2mc_driver (KFlop)
#7 - blank

Tom, we have another issue with our spindle. I was wondering if you could help with this as well.  The spindle and VFD are in working order and I can use it manually. The problem is when I switch it to except commands from the ACM/AUI off the KFlop.  I"m getting low DCV readings and the spindle runs slower when a higher speed in entered. Also, the frequency is not stable, it bounces up and down by a one or two hz.
M3 s3000 = 2.8DCV
M3 s6000 = 2.2DCV
M3 s9000 = 1.8DCV
This voltage translates to about 2500 rpm which is about a 45-60 frequency.

Thanks so much for looking at this.  You are much appreciated!
Robert
  @@attachment@@
Group: DynoMotion Message: 13494 From: mtr505 Date: 7/7/2016
Subject: Re: z-touch glitch? [1 Attachment]
Hi Tom,

I just noticed something else with my KMotionCNC.  When I activate it to start up the cnc, it defaults to inch units.  Not an issue but the strange thing is if I saved any Fixture Offset numbers in mm they are now read as inches. This then places the fixture offsets way out of the cnc working area.

This does not seem to be an issue when I save them as inches. (I check the inch unit box, then open Fixture Offset, input inch values, save and close.) When I input as inches the KMotion converts to mm when the gcode states the model is in mm.

I assume this is the way it works. I should enter all values as inches in the Fixture Offset and it will convert to mm as needed.

Robert
Group: DynoMotion Message: 13500 From: Tom Kerekes Date: 7/7/2016
Subject: Re: z-touch glitch? [2 Attachments]

Hi Robert,

Please go through your files and post only the ones that you are actually using and clean out all the rest.

You might start with the KMotionCNC Tool Setup Screen MCodes/S/User Buttons and make a table of what function references which file.  Then look at those files and see which files they include. There may be nested references so don't forget those. Include the K2mc_driver.c program as it is probably assumed to be flashed in KFLOP and not referenced my any Button or MCode.

I really don't have any idea how the machine is interfaced to control the Spindle.  I assume some PWM to analog method?  What is the ACM/AUI you refer to?

Regards

TK


On 7/7/2016 7:58 AM, robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,

I'm not sure which files to send so I will attached to folders.  One is labled KFlop_copy and the other KFlop_old_copy.  I was only able to find the tool touch file in old_copy but I think all other files are from KFlop..... As you can see our files are a bit jumbled. Someone had copied files to try to save them but it looks like some were lost or not transferred to the new KFlop when we up graded to 432.  More than one person has tried to work on this.... I tried moving the tool touch program into the KFlop with the rest of the used files but then the touch off did not work.  I will try again.

Also, here is a list of what is "visible" in the Threads. I know that you have said in the past that what you see may not be what is loaded in the Threads.  In the ConFig screen only Thread #6 is listed as launch at start-up.
Threads:
#1 - bitlog_sLimit (KFlop)
#2 - InitStepDir 3 Axis (KM 432 CPrograms)
#3 - StopCallBack (KFlop)
#4 - SetStepPulseLength (KM 432 CPrograms)
#5 - homing_XYZ (KFlop)
#6 - K2mc_driver (KFlop)
#7 - blank

Tom, we have another issue with our spindle. I was wondering if you could help with this as well.  The spindle and VFD are in working order and I can use it manually. The problem is when I switch it to except commands from the ACM/AUI off the KFlop.  I"m getting low DCV readings and the spindle runs slower when a higher speed in entered. Also, the frequency is not stable, it bounces up and down by a one or two hz.
M3 s3000 = 2.8DCV
M3 s6000 = 2.2DCV
M3 s9000 = 1.8DCV
This voltage translates to about 2500 rpm which is about a 45-60 frequency.

Thanks so much for looking at this.  You are much appreciated!
Robert


Group: DynoMotion Message: 13504 From: mtr505 Date: 7/7/2016
Subject: Re: z-touch glitch? [2 Attachments]
Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert
Group: DynoMotion Message: 13514 From: Robert Taormina Date: 7/8/2016
Subject: Re: z-touch glitch?

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert

  @@attachment@@
Group: DynoMotion Message: 13516 From: Tom Kerekes Date: 7/8/2016
Subject: Re: z-touch glitch? [2 Attachments]

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert


  @@attachment@@
Group: DynoMotion Message: 13518 From: Robert Taormina Date: 7/9/2016
Subject: Re: z-touch glitch? [1 Attachment]
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert


Group: DynoMotion Message: 13528 From: Robert Taormina Date: 7/11/2016
Subject: Re: z-touch glitch?

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again. Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.  I noticed that some new "out" files were generated. Do these have anything to do with my new problem? If I put the original programs back into the ToolSetUp why doesn't it run like it used too?


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?


Confused,

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert


Group: DynoMotion Message: 13531 From: Tom Kerekes Date: 7/11/2016
Subject: Re: z-touch glitch?

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert



Group: DynoMotion Message: 13548 From: Robert Taormina Date: 7/13/2016
Subject: Re: z-touch glitch?

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert



Group: DynoMotion Message: 13552 From: Tom Kerekes Date: 7/13/2016
Subject: Re: z-touch glitch?

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert




Group: DynoMotion Message: 13554 From: Robert Taormina Date: 7/13/2016
Subject: Re: z-touch glitch?

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert




  @@attachment@@
Group: DynoMotion Message: 13558 From: Tom Kerekes Date: 7/13/2016
Subject: Re: z-touch glitch? [3 Attachments]

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert





Group: DynoMotion Message: 13563 From: Robert Taormina Date: 7/14/2016
Subject: Re: z-touch glitch?

Good morning Tom,


So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

#include "KMotionDef.h"
#define HomingStart 1026
#define HOMING_PERSIST 13

int main()
{
    ClearBit(HomingStart);    
    Delay_sec(0.5);
    SetBit(HomingStart);
    return 0;
}

Very short program and extremely buggy and doesn't home the A axis.
The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

Thanks,
Robert



The Homing Program that I sent you is stable but


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 7:52:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert





Group: DynoMotion Message: 13566 From: Robert Taormina Date: 7/14/2016
Subject: Re: z-touch glitch?

Tom,


I have some additional information that may help.  The sample file I set up to test the z-touch will do a G28 soft home before it begins. If I don't home the machine first, the g-code will soft home xyz first, start the cnc moving and then while the cnc is moving, I noticed that it will also turn and set the A Axis to 0!  I don't know if this is helpful but I will post the beginning of the G code here:

%
(62x100x100 B)
(z-touch test )
(T14 D=5 CR=0.5 - ZMIN=62.01 - bullnose end mill)
N10 G90 G94
N15 G17
N20 G21
N25 G28 G91 Z0
N30 G90

(Adaptive1)
N35 M9
N40 T14 M6
N45 S4950 M3
N50 G54
N55 M8
N65 G0 X-100.502 Y-5.784
N70 G43 Z82 H14
N75 Z72
N80 Z63.01


I'm not using any Tool commands but this is what Fusion 360 generates. All my tools are blank.

Robert


From: Robert Taormina
Sent: Thursday, July 14, 2016 10:55:30 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 

Good morning Tom,


So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

#include "KMotionDef.h"
#define HomingStart 1026
#define HOMING_PERSIST 13

int main()
{
    ClearBit(HomingStart);    
    Delay_sec(0.5);
    SetBit(HomingStart);
    return 0;
}

Very short program and extremely buggy and doesn't home the A axis.
The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

Thanks,
Robert



The Homing Program that I sent you is stable but


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 7:52:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert





Group: DynoMotion Message: 13568 From: Tom Kerekes Date: 7/14/2016
Subject: Re: z-touch glitch?

Hi Robert,

It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

Add printf the statements to the beginning and end of the function Home_Single()

printf("Entering Home_Single now\n");

printf("Exiting Home_Single now\n");

Regards

TK




On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Good morning Tom,


So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

#include "KMotionDef.h"
#define HomingStart 1026
#define HOMING_PERSIST 13

int main()
{
    ClearBit(HomingStart);    
    Delay_sec(0.5);
    SetBit(HomingStart);
    return 0;
}

Very short program and extremely buggy and doesn't home the A axis.
The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

Thanks,
Robert



The Homing Program that I sent you is stable but


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 7:52:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert






Group: DynoMotion Message: 13571 From: Robert Taormina Date: 7/14/2016
Subject: Re: z-touch glitch?

Hi Tom,


I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 14, 2016 12:51:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

Add printf the statements to the beginning and end of the function Home_Single()

printf("Entering Home_Single now\n");

printf("Exiting Home_Single now\n");

Regards

TK




On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Good morning Tom,


So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

#include "KMotionDef.h"
#define HomingStart 1026
#define HOMING_PERSIST 13

int main()
{
    ClearBit(HomingStart);    
    Delay_sec(0.5);
    SetBit(HomingStart);
    return 0;
}

Very short program and extremely buggy and doesn't home the A axis.
The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

Thanks,
Robert



The Homing Program that I sent you is stable but


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 7:52:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Tom,

Sorry about that.  I will go through and thin out the files.

And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

Thanks,
Robert






Group: DynoMotion Message: 13578 From: Tom Kerekes Date: 7/14/2016
Subject: Re: z-touch glitch?

Hi Robert,

That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

#include "KMotionDef.h"

main()
{
    int i;
    for (i=0;i<200;i++)
        printf("%d = %d\n",i,persist.UserData[i]);

}

HTH

Regards

TK


On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 14, 2016 12:51:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

Add printf the statements to the beginning and end of the function Home_Single()

printf("Entering Home_Single now\n");

printf("Exiting Home_Single now\n");

Regards

TK




On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Good morning Tom,


So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

#include "KMotionDef.h"
#define HomingStart 1026
#define HOMING_PERSIST 13

int main()
{
    ClearBit(HomingStart);    
    Delay_sec(0.5);
    SetBit(HomingStart);
    return 0;
}

Very short program and extremely buggy and doesn't home the A axis.
The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

Thanks,
Robert



The Homing Program that I sent you is stable but


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 7:52:09 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

It seems this is basically an open loop Step/Dir type of system.

It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

    savepos = chan[axis].Position;

to

    savepos = chan[axis].Dest;

Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

Regards

TK


On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I've attached the Home file and the two files listed.

Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

Can you explain what you need for the limit switch? It's an E-switch 15amp style.

And where would I find the information for the Index Pulse?


Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Wednesday, July 13, 2016 1:12:33 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

Can you post the Home Program you are currently using along with any included files?

Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

Regards

TK


On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


Good news, your z tool touch works great!  thank you.


I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


Is the A axis waiting for something that may not be checked or missing?


Any thoughts??? and selling the machine is not an option:)


Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Monday, July 11, 2016 6:40:56 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

Hi Robert,

See below:


On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hello Tom,


I have run into some issues.  I made some assumptions let me explain.


I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

>>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

>>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

>>>> The program is written to just move Z down immediately.   I don't know why it would Home.


I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

>>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

>>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

  I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

>>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

>>>> I don't know.  Something must have changed.


I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

>>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


Confused,

>>> Me too :)
TK

Robert




From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Saturday, July 9, 2016 11:49:11 AM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 
Hi Tom, 
Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
Robert


On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Robert,

Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

HTH
Regards
TK

On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
 

Hi Tom,


I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

Please let me know if I'm on the right track.


Thanks,

Robert


From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
Sent: Thursday, July 7, 2016 3:54:06 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] z-touch glitch?
 
 

(Message over 64 KB, truncated)
Group: DynoMotion Message: 13582 From: Robert Taormina Date: 7/15/2016
Subject: Re: z-touch glitch?
Attachments :

    Good Morning Tom,


    It sounds like K2CNC made some questionable decisions. This may be a naive question, but is it easier to start over and use the KFLOP as it was intended? In other words are others dumping K2CNC methods and repairing their K2CNC to run like others? Have you helped others to do this? I would gladly rename my cnc to the TKCNC ��


    Well as for the things you've asked I am afraid I will need further instruction. I tried adding the printf statements to the program that is under the button but nothing happened.  I was going to try this next to the possibly flashed program but I thought I should print all the programs in the KFLOP out first.  Which brings me to the next question.  How do I use the simple program that you sent me? and when things print, where does it print to so that I can find it? 


    Thanks,

    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Thursday, July 14, 2016 5:59:30 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

    I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

    So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

    The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

    #include "KMotionDef.h"

    main()
    {
        int i;
        for (i=0;i<200;i++)
            printf("%d = %d\n",i,persist.UserData[i]);

    }

    HTH

    Regards

    TK


    On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


    I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


    Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


    Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


    Thanks,

    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Thursday, July 14, 2016 12:51:09 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

    Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

    Add printf the statements to the beginning and end of the function Home_Single()

    printf("Entering Home_Single now\n");

    printf("Exiting Home_Single now\n");

    Regards

    TK




    On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Good morning Tom,


    So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


    I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


    I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

    #include "KMotionDef.h"
    #define HomingStart 1026
    #define HOMING_PERSIST 13

    int main()
    {
        ClearBit(HomingStart);    
        Delay_sec(0.5);
        SetBit(HomingStart);
        return 0;
    }

    Very short program and extremely buggy and doesn't home the A axis.
    The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

    Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

    I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

    Thanks,
    Robert



    The Homing Program that I sent you is stable but


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Wednesday, July 13, 2016 7:52:09 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

    It seems this is basically an open loop Step/Dir type of system.

    It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

        savepos = chan[axis].Position;

    to

        savepos = chan[axis].Dest;

    Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

    Regards

    TK


    On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    I've attached the Home file and the two files listed.

    Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

    Can you explain what you need for the limit switch? It's an E-switch 15amp style.

    And where would I find the information for the Index Pulse?


    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Wednesday, July 13, 2016 1:12:33 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    Can you post the Home Program you are currently using along with any included files?

    Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

    Regards

    TK


    On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    Good news, your z tool touch works great!  thank you.


    I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


    But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


    The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


    Is the A axis waiting for something that may not be checked or missing?


    Any thoughts??? and selling the machine is not an option:)


    Robert




    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Monday, July 11, 2016 6:40:56 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    See below:


    On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hello Tom,


    I have run into some issues.  I made some assumptions let me explain.


    I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

    >>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


    Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

    >>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

    Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

    >>>> The program is written to just move Z down immediately.   I don't know why it would Home.


    I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

    >>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


    So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

    >>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

      I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

    >>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

    If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

    >>>> I don't know.  Something must have changed.


    I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

    >>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


    Confused,

    >>> Me too :)
    TK

    Robert




    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Saturday, July 9, 2016 11:49:11 AM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     
    Hi Tom, 
    Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
    Robert


    On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

     

    Hi Robert,

    Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

    BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

    HTH
    Regards
    TK

    On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

    Please let me know if I'm on the right track.


    Thanks,

    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Thursday, July 7, 2016 3:54:06 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Tom,

    Sorry about that.  I will go through and thin out the files.

    And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

    Thanks,
    Robert







    Group: DynoMotion Message: 13584 From: Tom Kerekes Date: 7/15/2016
    Subject: Re: z-touch glitch?

    Hi Robert,

    It is probably less effort to reverse engineer what K2CNC did and get it to work rather than starting from scratch without knowing what the components are and how things are wired.

    To use the simple program I sent:

    #1 Run KMotion.exe

    #2 Open the Console Screen

    #3 Open the C Programs Screen

    #4 pick any Thread

    #5 Select "New" (so name is changed and we don't overwrite any previous files)

    #6 Select "Save As" and provide a name and path to where you want the program saved

    #7 copy/paste in the program I sent in my email

    #8 Push the Save/Compile/Download/Execute button (button with all the arrows)

    #9 observe no errors and variables printed to the Console Screen

    HTH

    Regards

    TK



    On 7/15/2016 8:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Good Morning Tom,


    It sounds like K2CNC made some questionable decisions. This may be a naive question, but is it easier to start over and use the KFLOP as it was intended? In other words are others dumping K2CNC methods and repairing their K2CNC to run like others? Have you helped others to do this? I would gladly rename my cnc to the TKCNC ��


    Well as for the things you've asked I am afraid I will need further instruction. I tried adding the printf statements to the program that is under the button but nothing happened.  I was going to try this next to the possibly flashed program but I thought I should print all the programs in the KFLOP out first.  Which brings me to the next question.  How do I use the simple program that you sent me? and when things print, where does it print to so that I can find it? 


    Thanks,

    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Thursday, July 14, 2016 5:59:30 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

    I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

    So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

    The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

    #include "KMotionDef.h"

    main()
    {
        int i;
        for (i=0;i<200;i++)
            printf("%d = %d\n",i,persist.UserData[i]);

    }

    HTH

    Regards

    TK


    On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


    I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


    Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


    Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


    Thanks,

    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Thursday, July 14, 2016 12:51:09 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

    Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

    Add printf the statements to the beginning and end of the function Home_Single()

    printf("Entering Home_Single now\n");

    printf("Exiting Home_Single now\n");

    Regards

    TK




    On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Good morning Tom,


    So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


    I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


    I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

    #include "KMotionDef.h"
    #define HomingStart 1026
    #define HOMING_PERSIST 13

    int main()
    {
        ClearBit(HomingStart);    
        Delay_sec(0.5);
        SetBit(HomingStart);
        return 0;
    }

    Very short program and extremely buggy and doesn't home the A axis.
    The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

    Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

    I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

    Thanks,
    Robert



    The Homing Program that I sent you is stable but


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Wednesday, July 13, 2016 7:52:09 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

    It seems this is basically an open loop Step/Dir type of system.

    It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

        savepos = chan[axis].Position;

    to

        savepos = chan[axis].Dest;

    Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

    Regards

    TK


    On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    I've attached the Home file and the two files listed.

    Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

    Can you explain what you need for the limit switch? It's an E-switch 15amp style.

    And where would I find the information for the Index Pulse?


    Robert


    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Wednesday, July 13, 2016 1:12:33 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    Can you post the Home Program you are currently using along with any included files?

    Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

    Regards

    TK


    On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hi Tom,


    Good news, your z tool touch works great!  thank you.


    I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


    But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


    The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


    Is the A axis waiting for something that may not be checked or missing?


    Any thoughts??? and selling the machine is not an option:)


    Robert




    From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
    Sent: Monday, July 11, 2016 6:40:56 PM
    To: DynoMotion@yahoogroups.com
    Subject: Re: [DynoMotion] z-touch glitch?
     
     

    Hi Robert,

    See below:


    On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
     

    Hello Tom,


    I have run into some issues.  I made some assumptions let me explain.


    I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

    >>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


    Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

    >>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

    Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

    >>>> The program is written to just move Z down immediately.   I don't know why it would Home.


    I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

    >>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


    So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

    >>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

      I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

    >>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

    If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

    >>>> I don't know.  Something must have changed.


    I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

    >>>> I don't recognize

    (Message over 64 KB, truncated)
    Group: DynoMotion Message: 13585 From: Robert Taormina Date: 7/15/2016
    Subject: Re: z-touch glitch?
    Attachments :

      Tom,


      Ran the program and this is what was on the bottom.

      No Errors, No Warnings, text=344, bss=0, data=9, total=384


      Look good?


      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Friday, July 15, 2016 2:05:36 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      It is probably less effort to reverse engineer what K2CNC did and get it to work rather than starting from scratch without knowing what the components are and how things are wired.

      To use the simple program I sent:

      #1 Run KMotion.exe

      #2 Open the Console Screen

      #3 Open the C Programs Screen

      #4 pick any Thread

      #5 Select "New" (so name is changed and we don't overwrite any previous files)

      #6 Select "Save As" and provide a name and path to where you want the program saved

      #7 copy/paste in the program I sent in my email

      #8 Push the Save/Compile/Download/Execute button (button with all the arrows)

      #9 observe no errors and variables printed to the Console Screen

      HTH

      Regards

      TK



      On 7/15/2016 8:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Good Morning Tom,


      It sounds like K2CNC made some questionable decisions. This may be a naive question, but is it easier to start over and use the KFLOP as it was intended? In other words are others dumping K2CNC methods and repairing their K2CNC to run like others? Have you helped others to do this? I would gladly rename my cnc to the TKCNC ��


      Well as for the things you've asked I am afraid I will need further instruction. I tried adding the printf statements to the program that is under the button but nothing happened.  I was going to try this next to the possibly flashed program but I thought I should print all the programs in the KFLOP out first.  Which brings me to the next question.  How do I use the simple program that you sent me? and when things print, where does it print to so that I can find it? 


      Thanks,

      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Thursday, July 14, 2016 5:59:30 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

      I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

      So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

      The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

      #include "KMotionDef.h"

      main()
      {
          int i;
          for (i=0;i<200;i++)
              printf("%d = %d\n",i,persist.UserData[i]);

      }

      HTH

      Regards

      TK


      On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


      I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


      Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


      Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


      Thanks,

      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Thursday, July 14, 2016 12:51:09 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

      Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

      Add printf the statements to the beginning and end of the function Home_Single()

      printf("Entering Home_Single now\n");

      printf("Exiting Home_Single now\n");

      Regards

      TK




      On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Good morning Tom,


      So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


      I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


      I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

      #include "KMotionDef.h"
      #define HomingStart 1026
      #define HOMING_PERSIST 13

      int main()
      {
          ClearBit(HomingStart);    
          Delay_sec(0.5);
          SetBit(HomingStart);
          return 0;
      }

      Very short program and extremely buggy and doesn't home the A axis.
      The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

      Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

      I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

      Thanks,
      Robert



      The Homing Program that I sent you is stable but


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Wednesday, July 13, 2016 7:52:09 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

      It seems this is basically an open loop Step/Dir type of system.

      It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

          savepos = chan[axis].Position;

      to

          savepos = chan[axis].Dest;

      Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

      Regards

      TK


      On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      I've attached the Home file and the two files listed.

      Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

      Can you explain what you need for the limit switch? It's an E-switch 15amp style.

      And where would I find the information for the Index Pulse?


      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Wednesday, July 13, 2016 1:12:33 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      Can you post the Home Program you are currently using along with any included files?

      Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

      Regards

      TK


      On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      Good news, your z tool touch works great!  thank you.


      I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


      But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


      The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


      Is the A axis waiting for something that may not be checked or missing?


      Any thoughts??? and selling the machine is not an option:)


      Robert




      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Monday, July 11, 2016 6:40:56 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      See below:


      On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hello Tom,


      I have run into some issues.  I made some assumptions let me explain.


      I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

      >>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


      Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

      >>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

      Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

      >>>> The program is written to just move Z down immediately.   I don't know why it would Home.


      I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

      >>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


      So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

      >>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

        I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

      >>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

      If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

      >>>> I don't know.  Something must have changed.


      I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

      >>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


      Confused,

      >>> Me too :)
      TK

      Robert




      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Saturday, July 9, 2016 11:49:11 AM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       
      Hi Tom, 
      Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
      Robert


      On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

       

      Hi Robert,

      Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

      BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

      HTH
      Regards
      TK

      On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

      Please let me know if I'm on the right track.


      Thanks,

      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Thursday, July 7, 2016 3:54:06 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Tom,

      Sorry about that.  I will go through and thin out the files.

      And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

      Thanks,
      Robert







      Group: DynoMotion Message: 13586 From: Tom Kerekes Date: 7/15/2016
      Subject: Re: z-touch glitch?

      Hi Robert,

      Yes.  What about the Console Screen?

      Regards

      TK


      On 7/15/2016 11:19 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Tom,


      Ran the program and this is what was on the bottom.

      No Errors, No Warnings, text=344, bss=0, data=9, total=384


      Look good?


      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Friday, July 15, 2016 2:05:36 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      It is probably less effort to reverse engineer what K2CNC did and get it to work rather than starting from scratch without knowing what the components are and how things are wired.

      To use the simple program I sent:

      #1 Run KMotion.exe

      #2 Open the Console Screen

      #3 Open the C Programs Screen

      #4 pick any Thread

      #5 Select "New" (so name is changed and we don't overwrite any previous files)

      #6 Select "Save As" and provide a name and path to where you want the program saved

      #7 copy/paste in the program I sent in my email

      #8 Push the Save/Compile/Download/Execute button (button with all the arrows)

      #9 observe no errors and variables printed to the Console Screen

      HTH

      Regards

      TK



      On 7/15/2016 8:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Good Morning Tom,


      It sounds like K2CNC made some questionable decisions. This may be a naive question, but is it easier to start over and use the KFLOP as it was intended? In other words are others dumping K2CNC methods and repairing their K2CNC to run like others? Have you helped others to do this? I would gladly rename my cnc to the TKCNC ��


      Well as for the things you've asked I am afraid I will need further instruction. I tried adding the printf statements to the program that is under the button but nothing happened.  I was going to try this next to the possibly flashed program but I thought I should print all the programs in the KFLOP out first.  Which brings me to the next question.  How do I use the simple program that you sent me? and when things print, where does it print to so that I can find it? 


      Thanks,

      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Thursday, July 14, 2016 5:59:30 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

      I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

      So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

      The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

      #include "KMotionDef.h"

      main()
      {
          int i;
          for (i=0;i<200;i++)
              printf("%d = %d\n",i,persist.UserData[i]);

      }

      HTH

      Regards

      TK


      On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


      I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


      Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


      Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


      Thanks,

      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Thursday, July 14, 2016 12:51:09 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

      Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

      Add printf the statements to the beginning and end of the function Home_Single()

      printf("Entering Home_Single now\n");

      printf("Exiting Home_Single now\n");

      Regards

      TK




      On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Good morning Tom,


      So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


      I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


      I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

      #include "KMotionDef.h"
      #define HomingStart 1026
      #define HOMING_PERSIST 13

      int main()
      {
          ClearBit(HomingStart);    
          Delay_sec(0.5);
          SetBit(HomingStart);
          return 0;
      }

      Very short program and extremely buggy and doesn't home the A axis.
      The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

      Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

      I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

      Thanks,
      Robert



      The Homing Program that I sent you is stable but


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Wednesday, July 13, 2016 7:52:09 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

      It seems this is basically an open loop Step/Dir type of system.

      It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

          savepos = chan[axis].Position;

      to

          savepos = chan[axis].Dest;

      Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

      Regards

      TK


      On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      I've attached the Home file and the two files listed.

      Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

      Can you explain what you need for the limit switch? It's an E-switch 15amp style.

      And where would I find the information for the Index Pulse?


      Robert


      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Wednesday, July 13, 2016 1:12:33 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      Can you post the Home Program you are currently using along with any included files?

      Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

      Regards

      TK


      On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hi Tom,


      Good news, your z tool touch works great!  thank you.


      I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


      But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


      The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


      Is the A axis waiting for something that may not be checked or missing?


      Any thoughts??? and selling the machine is not an option:)


      Robert




      From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
      Sent: Monday, July 11, 2016 6:40:56 PM
      To: DynoMotion@yahoogroups.com
      Subject: Re: [DynoMotion] z-touch glitch?
       
       

      Hi Robert,

      See below:


      On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
       

      Hello Tom,


      I have run into some issues.  I made some assumptions let me explain.


      I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

      >>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


      Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

      >>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

      Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

      >>>> The program is written to just move Z down immediately.   I don't know why it would Home.


      I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem

      (Message over 64 KB, truncated)

      Group: DynoMotion Message: 13587 From: Robert Taormina Date: 7/15/2016
      Subject: Re: z-touch glitch?
      Attachments :

        It has a bunch of numbers with = to other numbers.  Do you want me to paste them?


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 2:24:14 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Yes.  What about the Console Screen?

        Regards

        TK


        On 7/15/2016 11:19 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Tom,


        Ran the program and this is what was on the bottom.

        No Errors, No Warnings, text=344, bss=0, data=9, total=384


        Look good?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 2:05:36 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It is probably less effort to reverse engineer what K2CNC did and get it to work rather than starting from scratch without knowing what the components are and how things are wired.

        To use the simple program I sent:

        #1 Run KMotion.exe

        #2 Open the Console Screen

        #3 Open the C Programs Screen

        #4 pick any Thread

        #5 Select "New" (so name is changed and we don't overwrite any previous files)

        #6 Select "Save As" and provide a name and path to where you want the program saved

        #7 copy/paste in the program I sent in my email

        #8 Push the Save/Compile/Download/Execute button (button with all the arrows)

        #9 observe no errors and variables printed to the Console Screen

        HTH

        Regards

        TK



        On 7/15/2016 8:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Good Morning Tom,


        It sounds like K2CNC made some questionable decisions. This may be a naive question, but is it easier to start over and use the KFLOP as it was intended? In other words are others dumping K2CNC methods and repairing their K2CNC to run like others? Have you helped others to do this? I would gladly rename my cnc to the TKCNC ��


        Well as for the things you've asked I am afraid I will need further instruction. I tried adding the printf statements to the program that is under the button but nothing happened.  I was going to try this next to the possibly flashed program but I thought I should print all the programs in the KFLOP out first.  Which brings me to the next question.  How do I use the simple program that you sent me? and when things print, where does it print to so that I can find it? 


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 14, 2016 5:59:30 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        That is the question.  We don't know how K2CNC set up things to work.  And also why we don't recommend Flashing programs into KFLOP because it is confusing and requires keeping track of what has been Flashed into what Threads.  Its much simpler if one just assigns a Program to a button. 

        I think K2CNC flashed their "Driver" Program into the board.  Sometimes they also flashed the Home Program into a Thread.  Then to Home they just set a bit or did something to launch it. 

        So yes, if you assign a Program to a User button then there is no question if you push that button that Program will be compiled/downloaded/executed.  There is no need to Flash it.  The only question is whether it somehow makes use of code flashed in other Threads.  The Homing code you posted earlier seemed to be self contained and not do that.  I still recommend you adding the Print statements like I described.

        The other confusing thing K2CNC did was they Flashed Persist Variables that the programs read to change how they behaved.  So the type of axes, the direction it should home, etc... could supposedly be all configured by just changing some persist variables with no need to change any of the programs.  But it looks to me that they never fully got to that point and ended up with a mixture of both changing C Program code and Flashed persist variables to get things to work.  You should probably record all of them in case you ever loose that KFLOP.  Here is a program to print them all out:

        #include "KMotionDef.h"

        main()
        {
            int i;
            for (i=0;i<200;i++)
                printf("%d = %d\n",i,persist.UserData[i]);

        }

        HTH

        Regards

        TK


        On 7/14/2016 10:35 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I haven't been flashing any files.....I've only been swapping files in and out of the ToolSetUp buttons.  I thought they were different than the flashed programs.


        I just checked what was in KMotion and in thread #5 this is listed: homing_ZYX.c This is not the file I sent you or the file I have in the Home Button.  Would the file in the Home Button be different than the one Flashed? Or  could the flashed file have been messed up? I understand that what you see may not be what is Flashed.


        Under the KFLOP /Diver file I notice that there is also a homing_ZAXYB.c file.


        Before I do anything do you think I should re-flash everything? Should the program for the button be the same as the flashed? What are your thoughts?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 14, 2016 12:51:09 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It isn't clear to me if you understand that just changing the file won't have any effect.  It needs to be compiled/downloaded and possibly Flashed to the KFLOP Thread.

        Let's add some diagnostic print messages to the Home_Single() function.  That will prove that the code that you changed is really being used as well as what is happening when.

        Add printf the statements to the beginning and end of the function Home_Single()

        printf("Entering Home_Single now\n");

        printf("Exiting Home_Single now\n");

        Regards

        TK




        On 7/14/2016 7:55 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Good morning Tom,


        So, I changed the code and nothing seemed to change. So, I changed it back.  But let me describe other things I have noticed.


        I checked the A axis jog buttons and they work in both directions. After engaging the Homing button and xyz homes then the A axis turns then stops at the limit switch reverses slowly till it clicks again but then it rotates forward again. So, it seems to notice the limit switch and does as you described but then it rotates continuously until I hit pause.


        I don't know if I should mention this but I have another Homing program but when I drop/replace it into the KFLOP file it's buggy!  This was the program that I was using before I started working with the z-touch off What I mean by this is that the cnc crashes randomly. Also, it does not home the A axis! This program is dated 9/19/2013. And just for full discloser It lists the following included files:

        #include "KMotionDef.h"
        #define HomingStart 1026
        #define HOMING_PERSIST 13

        int main()
        {
            ClearBit(HomingStart);    
            Delay_sec(0.5);
            SetBit(HomingStart);
            return 0;
        }

        Very short program and extremely buggy and doesn't home the A axis.
        The Homing program that I sent you works much better except that the A axis does not seem to register the limit and then stop. It goes through the motions and continues on.

        Tom, I appreciate the time you are putting into this, I know working on something blind is a challenge but I'm glad you are helping. As you can tell, I don't know much about cnc or programing. If you have any suggestions of good books to start with I would be happy to look them up.

        I'm going to check my files and see if I moved anything by accident and if you have some more suggestions please send them my way.

        Thanks,
        Robert



        The Homing Program that I sent you is stable but


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 13, 2016 7:52:09 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Its so hard to work on a system when you don't know what components are involved and how it is supposed to function.

        It seems this is basically an open loop Step/Dir type of system.

        It looks like they are capturing the Encoder Position where the Home switch is detected.  I'm not sure the Encoder position at that point even if it exists may always be valid.  Try capturing the Commanded Destination instead.  In the K2_Home file change:

            savepos = chan[axis].Position;

        to

            savepos = chan[axis].Dest;

        Regarding the A axis.  Maybe the direction signal is broken.  All the axes are programmed to move to the switch activates, then reverse direction slowly until the switch deactivates.  If A continues in the same direction then maybe the direction is simply not working.  Can you Jog the A Axis both directions before you home?

        Regards

        TK


        On 7/13/2016 12:02 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I've attached the Home file and the two files listed.

        Axis A is rotary and is a Delta AC Servo -ECMA C2604ES, Delta Encoder ASDA-B2

        Can you explain what you need for the limit switch? It's an E-switch 15amp style.

        And where would I find the information for the Index Pulse?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 13, 2016 1:12:33 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Can you post the Home Program you are currently using along with any included files?

        Did you look at the A Axis homing sequence to try to see what it is trying to do?  Do you know what type of hardware is on the A axis?  What kind of motor?  Encoder?  Limit switch? Index pulse? 

        Regards

        TK


        On 7/13/2016 9:17 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Good news, your z tool touch works great!  thank you.


        I checked my notes and went over all the previous setting. I swear there is a ghost in this machine. I did not put the ztouch in the S file!  But yet there it was.  So, I put the Spindle file back in its place and then I started to check the Home file. For some reason the one I had and the one I sent you was not working.  I looked at an old saved KFLOP folder and the home was different.  So, I dropped it in to the active KFLOP folder and I put it under the HOME button and it started homing again.


        But there seems to be two glitches.  One is sporadic, happening occasionally, and can be fixed by toggling the main power off/on which shut the power off on the KFlop and AC drivers.  This problem happens after I've run a few jobs.  Sometimes a glitch shows up where after it Homes it then moves the X or Y axis over a few inches and sets this as Home. If I Home again, it moves it over twice the distance as the first time and will continue doubling the distance after each Homing routine.  Like I mentioned, if I power off/on it fixes this glitch.


        The second glitch is with the 4th A axis. After Homing, it spins slowly until it hits it's limit switch but it only pauses for a moment and then continues to spin slowly.  I can stop it by hitting the pause button in the Jog Buttons.


        Is the A axis waiting for something that may not be checked or missing?


        Any thoughts??? and selling the machine is not an option:)


        Robert




        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 11, 2016 6:40:56 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        See below:


        On 7/11/2016 8:07 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hello Tom,


        I have run into some issues.  I made some assumptions let me explain.


        I noticed that the file you sent had a txt added so I saved as and just used the .c I then put the program into the KFLOP file and loaded it into the ToolSetUp user button Z-Touch Zero.  Was this file meant to have the .c.txt file type and if so where was I supposed to file it? I assumed the .txt was just for viewing.

        >>>> Yes the .txt was just to help send it through email and Yahoo that sometimes doesn't like odd file extentions


        Tested the button and received an error stating that it included program KMotion433 was not found.  I'm running KMotion432 so I just replaced the 3 with a 2 and tried again.

        >>>> Yes point to wherever the files are located.  Hopefully you will upgrade to V4.33 at some point.

        Started to work with a glitch. It moved to Home first (it seems to always want to do this) and then instead of moving over to the G54 off-set position it started to slowly move the z axis down and wanted to crash it into the table. I stopped it short of this.

        >>>> The program is written to just move Z down immediately.   I don't know why it would Home.


        I then remembered that under the ToolSetUp screen the S was the old z-touch so I changed that to the new one and ran some tests but the same problem persisted. 

        >>>>>The "S" action should have to do with setting Spindle Speed.  Why would you configure it to do Z-touch off?


        So, I then deleted the new file you sent me from the KFLOP folder and reloaded the old version into the buttons but I still have the same problem - the z-axis wants to run itself into the table bed very slowly.

        >>>>>If you restored everything properly you should get the same behavior as before.  But both the old and new Z-touch off programs are written to just immediately move Z down toward the table until the probe triggers.  So I'm not sure why that is unexpected.   I assume it was doing something different before?

          I noticed that some new "out" files were generated. Do these have anything to do with my new problem?

        >>>> No. Those are temporary files created when a file is compiled and downloaded.  You can delete them if you wish.

        If I put the original programs back into the ToolSetUp why doesn't it run like it used too?

        >>>> I don't know.  Something must have changed.


        I notice that you also added ame_ to the front of the file.  Should this also have been deleted from the file name before using?

        >>>> I don't recognize that.  I didn't intend to add that.  I don't see it on the file on the Yahoo Group site.


        Confused,

        >>> Me too :)
        TK

        Robert




        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 9, 2016 11:49:11 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         
        Hi Tom, 
        Thank you for you help with this and the tip about the settings file. Im not in the shop today but will check it out on Monday. 
        Robert


        On Jul 8, 2016, at 7:17 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

         

        Hi Robert,

        Perfect.  I've attached a simplified and modified file that should handle the touch offset in the current units.

        BTW how the Interpreter starts up by default can be set in the Settings file.  See the inches.set example.

        HTH
        Regards
        TK

        On 7/8/2016 1:27 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I put together an excel sheet with a list of the programs used with which buttons/actions. From that list I compiled a file folder of all the programs that I could tell were listed or referenced.

        Please let me know if I'm on the right track.


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 7, 2016 3:54:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Tom,

        Sorry about that.  I will go through and thin out the files.

        And yes, the ACM/AUI pins are on the brakeout board which send the PWM to analog signal to the VFD controller. At least that's how it was described to me.

        Thanks,
        Robert







        Group: DynoMotion Message: 13588 From: TKSOFT Date: 7/15/2016
        Subject: Re: z-touch glitch?
        Hi Robert,

        Yes. But mainly you should copy/paste those to a text file and back
        that up in case your KFLOP is ever lost and damaged and you need to put
        those into a new KFLOP. As well in case any of those get inadvertently
        modified.

        Regards
        TK


        On 2016-07-15 11:31, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > It has a bunch of numbers with = to other numbers. Do you want me to
        > paste them?
        >
        Group: DynoMotion Message: 13589 From: Robert Taormina Date: 7/15/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        OK, see below for what was in the console. I will save that as a tx file. In the "send" line it says Zero2. Is this important? In the future, how would I put this back into the KFLOP? I was expecting to see a list of programs that are currently in the KFLOP.


        Robert


        Fri, Jul 15, 2016, 02:29:56  KMotion Program Started
        0 = 12
        1 = 0
        2 = 0
        3 = 0
        4 = 0
        5 = 0
        6 = 0
        7 = 54321
        8 = 2
        9 = 204
        10 = 0
        11 = 7
        12 = 0
        13 = 7
        14 = 0
        15 = 0
        16 = 0
        17 = 0
        18 = 0
        19 = 0
        20 = 0
        21 = 0
        22 = 0
        23 = 0
        24 = 0
        25 = 0
        26 = 0
        27 = 0
        28 = 0
        29 = 0
        30 = 0
        31 = 1176256512
        32 = 0
        33 = 0
        34 = 0
        35 = 0
        36 = 0
        37 = 0
        38 = 0
        39 = 0
        40 = 20000
        41 = 30000
        42 = 50000
        43 = 0
        44 = 0
        45 = -1
        46 = -1
        47 = 0
        48 = 0
        49 = 0
        50 = 20000
        51 = 20000
        52 = 20000
        53 = 20000
        54 = 5000
        55 = 5000
        56 = 0
        57 = 0
        58 = 0
        59 = 0
        60 = 0
        61 = 0
        62 = 0
        63 = 0
        64 = 0
        65 = 0
        66 = 0
        67 = 0
        68 = 0
        69 = 0
        70 = 0
        71 = 0
        72 = 0
        73 = 0
        74 = 0
        75 = 0
        76 = 0
        77 = 0
        78 = 0
        79 = 0
        80 = 0
        81 = 0
        82 = 0
        83 = 0
        84 = 0
        85 = 0
        86 = 0
        87 = 0
        88 = 0
        89 = 0
        90 = 0
        91 = 0
        92 = 0
        93 = 0
        94 = 0
        95 = 0
        96 = 0
        97 = 0
        98 = 0
        99 = 0
        100 = 0
        101 = 0
        102 = 0
        103 = 0
        104 = 0
        105 = 0
        106 = 0
        107 = 0
        108 = 0
        109 = 0
        110 = 0
        111 = 0
        112 = 0
        113 = 0
        114 = 0
        115 = 0
        116 = 0
        117 = 0
        118 = 0
        119 = 0
        120 = 0
        121 = 1087950336
        122 = 0
        123 = 1087950336
        124 = 0
        125 = 1087950336
        126 = 0
        127 = 1086556160
        128 = 0
        129 = 1086556160
        130 = 0
        131 = 1086556160
        132 = 0
        133 = -1070071808
        134 = -1717986918
        135 = 1068079513
        136 = 0
        137 = -1069318144
        138 = -1717986918
        139 = 1069128089
        140 = 0
        141 = -1071906816
        142 = 0
        143 = 0
        144 = 0
        145 = -1053916032
        146 = 0
        147 = 1093567616
        148 = 0
        149 = -1053916032
        150 = 0
        151 = 1093567616
        152 = 0
        153 = -1053916032
        154 = 0
        155 = 1093567616
        156 = 0
        157 = 0
        158 = 0
        159 = 0
        160 = 0
        161 = 0
        162 = 0
        163 = 0
        164 = 0
        165 = 0
        166 = 0
        167 = 0
        168 = 0
        169 = 0
        170 = 0
        171 = 0
        172 = 0
        173 = 0
        174 = 0
        175 = 0
        176 = 0
        177 = 0
        178 = 0
        179 = 0
        180 = 0
        181 = 0
        182 = 0
        183 = 0
        184 = 0
        185 = 0
        186 = 0
        187 = 0
        188 = 0
        189 = 0
        190 = 0
        191 = 0
        192 = 0
        193 = 0
        194 = 0
        195 = 0
        196 = 0
        197 = 0
        198 = 0
        199 = 0


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 2:41:54 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Yes. But mainly you should copy/paste those to a text file and back
        that up in case your KFLOP is ever lost and damaged and you need to put
        those into a new KFLOP. As well in case any of those get inadvertently
        modified.

        Regards
        TK

        On 2016-07-15 11:31, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:

        > It has a bunch of numbers with = to other numbers. Do you want me to
        > paste them?
        >

        Group: DynoMotion Message: 13590 From: TKSOFT Date: 7/15/2016
        Subject: Re: z-touch glitch?
        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK


        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >
        Group: DynoMotion Message: 13591 From: Robert Taormina Date: 7/15/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:

        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13592 From: Tom Kerekes Date: 7/15/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13593 From: Robert Taormina Date: 7/15/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13596 From: Tom Kerekes Date: 7/15/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13597 From: Robert Taormina Date: 7/18/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13598 From: Tom Kerekes Date: 7/18/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13599 From: Robert Taormina Date: 7/18/2016
        Subject: Re: z-touch glitch?

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13603 From: Robert Taormina Date: 7/19/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13609 From: Tom Kerekes Date: 7/19/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13610 From: Robert Taormina Date: 7/19/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

          @@attachment@@
        Group: DynoMotion Message: 13617 From: Tom Kerekes Date: 7/20/2016
        Subject: Re: z-touch glitch? [2 Attachments]

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13619 From: Robert Taormina Date: 7/20/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        Thread #1 seemed to be the culprit. When I push halt before I home then all homes perfectly.


        What I see in the axis screen is #0-#5 have a check in "Enabled", the "Done" box have checks for the same numbers but they are shaded out. When I start the home program #2 starts homing first, the "done" stays shaded but unchecks and the Dest/Postion both increase first, then decreases to a small negative number and then drifts to zero and stops. This then happens the same way for #0, then#2, then#3.  Numbers #4and #5 do nothing but "Enabled" is checked and #6 and #7 do nothing, and nothing is checked but Dest is at "0" and Position stays at "1".


        Taking your clue of looking at which thread is green, I noticed that both 1 and 2 thread highlight when the homing is activated. But now that I've halted #1 only #2 is green and it turns off when the homing program stops.  I also noticed that if I power off/on thread #1 turns green again when homing, but if I halt it first before homing it works as expected. If I halt it once, it seems to stay halted unless the cnc messes up and I have to power the KFlop off/on to fix the glitch. Then the #1 thread become active again.


        Since bit_log_sLimit.c also includes all of these:

        include "KMotionDef.h"
        #include "defines.h"
        #include "pthread.h"
        #include "util.h"
        #include "..\k2_settings.h"
        Do you think the problem lies in the .c program or one of the .h programs?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 20, 2016 1:53:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13620 From: Tom Kerekes Date: 7/21/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        Thanks the the good descriptions.

        I believe that makes sense. Here is how I'm thinking K2CNC arranged things and what is happening:

        #1 Thread #6 has the "Driver" program Flashed and configured to run on startup

        #2 Thread #1 has the "Jog Limits" program Flashed

        #3 On Power UP the Driver program initializes things then tells Thread #1 to execute

        #4 Your Home program (the one we've been adding printf's in) is configured in KMotionCNC to load/run in Thread #2

        #5 At the end of the Home Program after Homing is complete it sets some flags/variables.  The running Thread #1 sees these flags and for whatever reason decides it should begin Jogging the A Axis.


        The "Jog Limits" program in Thread #1 seems very complex.  I don't really have time to analyze it.  It seems to even use SPI to communicate with something else to get I/O.  Maybe Jog Joysticks?  Buttons?

        Does everything seem to still function with Thread #1 Halted?


        Here are some ideas:

        #1 it would be easy to add a statement to Kill Thread #1 from your Home Program. PauseThread(1);

        #2 Looks like Jogging  Thread #1 may be disabled while the Homing Flag is set?  Maybe leave it set permanently.

        #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the problem.  The risk here is once you change what is flashed in KFLOP there is no way to restore it if you don't know exactly what needs to be put back.  If you make a mistake you might end up dead in the water.  A spare KFLOP would allow you to experiment without altering the original KFLOP.

        There is a way to experiment putting new programs into Threads #1 and #6 without re-Flashing.  You can halt all threads.  Then Compile/Download new programs to them.  Then Execute #6.  In this way you could see if the changed programs cause things to now behave properly.  But the risk is that the new programs might cause everything to work correctly but be missing something that the original programs Flashed in KFLOP did.  So then if flashed in by themselves would not work correctly.

        HTH

        Regards

        TK




        On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Thread #1 seemed to be the culprit. When I push halt before I home then all homes perfectly.


        What I see in the axis screen is #0-#5 have a check in "Enabled", the "Done" box have checks for the same numbers but they are shaded out. When I start the home program #2 starts homing first, the "done" stays shaded but unchecks and the Dest/Postion both increase first, then decreases to a small negative number and then drifts to zero and stops. This then happens the same way for #0, then#2, then#3.  Numbers #4and #5 do nothing but "Enabled" is checked and #6 and #7 do nothing, and nothing is checked but Dest is at "0" and Position stays at "1".


        Taking your clue of looking at which thread is green, I noticed that both 1 and 2 thread highlight when the homing is activated. But now that I've halted #1 only #2 is green and it turns off when the homing program stops.  I also noticed that if I power off/on thread #1 turns green again when homing, but if I halt it first before homing it works as expected. If I halt it once, it seems to stay halted unless the cnc messes up and I have to power the KFlop off/on to fix the glitch. Then the #1 thread become active again.


        Since bit_log_sLimit.c also includes all of these:

        include "KMotionDef.h"
        #include "defines.h"
        #include "pthread.h"
        #include "util.h"
        #include "..\k2_settings.h"
        Do you think the problem lies in the .c program or one of the .h programs?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 20, 2016 1:53:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 =

        (Message over 64 KB, truncated)

        Group: DynoMotion Message: 13621 From: Robert Taormina Date: 7/21/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        I like the idea of a second KFLOP so that we can experiment freely. I will have to see if I have any budget for it. I assume from the website it's about $249? The cnc seems to work with thread #1 halted.


        I also like the idea of simple. Not truly understanding the pitfalls of the flashed programs maybe we should try putting in a kill thread in the homing program first.  So, are you saying that the programs currently flashed may not be anywhere else on my computer?  Last year we lost everything and re-flashed the KFLOP with the programs that I previously listed. So, maybe I lost what we needed then. But with that said, maybe I did not do it correctly and maybe programs were still on it?  Just as a recap, I remember loading programs 1-6 into the threads and then save, compile, download, run. Then went to config/flash and hit flash user memory. I think I then had to disconnect the computer form the KFLOP and cycle the power.  I should say, I was not using the cnc before this and so I could not attest to how it ran before.


        Tom,  I still have some other issues with the machine. I know, one problem at a time, but just in case these problems are related I wanted to mention them.

        #1 The spindle speed is stuck on one speed. It bounces around from 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I can change the spindle to manual and it works in manual so I don't think its the VFD)

        #2 The GUI Feed override and Speed override do not respond. Nether does entering a speed manual line at the bottom of the GUI.

        #3 I noticed that the K2_Driver.c in thread #6 lists Thread number #4 as having ToolChange.c not SetStepPulseLencth.c which is what looks to be what I have in mine.

        #4 I also noticed that there is a homing program that is listed in thread #5 which is different than the homing program under the user buttons. Do you think one of these may be the wrong Homing program? I have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that it should be homing.c.  I'm wondering if last year I flashed the wrong homing program into the KFLOP?


        The instructor last year using this said he used to be able to change the speed as well as the feed rate override. 


        Also, I'm using 432 version. Most likely not but, could any of these issue be related to this version and would it be best to flash the new version?


        Thanks and sorry for all the questions, I just want to give you as much information as I can.

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 21, 2016 2:00:20 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Thanks the the good descriptions.

        I believe that makes sense. Here is how I'm thinking K2CNC arranged things and what is happening:

        #1 Thread #6 has the "Driver" program Flashed and configured to run on startup

        #2 Thread #1 has the "Jog Limits" program Flashed

        #3 On Power UP the Driver program initializes things then tells Thread #1 to execute

        #4 Your Home program (the one we've been adding printf's in) is configured in KMotionCNC to load/run in Thread #2

        #5 At the end of the Home Program after Homing is complete it sets some flags/variables.  The running Thread #1 sees these flags and for whatever reason decides it should begin Jogging the A Axis.


        The "Jog Limits" program in Thread #1 seems very complex.  I don't really have time to analyze it.  It seems to even use SPI to communicate with something else to get I/O.  Maybe Jog Joysticks?  Buttons?

        Does everything seem to still function with Thread #1 Halted?


        Here are some ideas:

        #1 it would be easy to add a statement to Kill Thread #1 from your Home Program. PauseThread(1);

        #2 Looks like Jogging  Thread #1 may be disabled while the Homing Flag is set?  Maybe leave it set permanently.

        #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the problem.  The risk here is once you change what is flashed in KFLOP there is no way to restore it if you don't know exactly what needs to be put back.  If you make a mistake you might end up dead in the water.  A spare KFLOP would allow you to experiment without altering the original KFLOP.

        There is a way to experiment putting new programs into Threads #1 and #6 without re-Flashing.  You can halt all threads.  Then Compile/Download new programs to them.  Then Execute #6.  In this way you could see if the changed programs cause things to now behave properly.  But the risk is that the new programs might cause everything to work correctly but be missing something that the original programs Flashed in KFLOP did.  So then if flashed in by themselves would not work correctly.

        HTH

        Regards

        TK




        On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Thread #1 seemed to be the culprit. When I push halt before I home then all homes perfectly.


        What I see in the axis screen is #0-#5 have a check in "Enabled", the "Done" box have checks for the same numbers but they are shaded out. When I start the home program #2 starts homing first, the "done" stays shaded but unchecks and the Dest/Postion both increase first, then decreases to a small negative number and then drifts to zero and stops. This then happens the same way for #0, then#2, then#3.  Numbers #4and #5 do nothing but "Enabled" is checked and #6 and #7 do nothing, and nothing is checked but Dest is at "0" and Position stays at "1".


        Taking your clue of looking at which thread is green, I noticed that both 1 and 2 thread highlight when the homing is activated. But now that I've halted #1 only #2 is green and it turns off when the homing program stops.  I also noticed that if I power off/on thread #1 turns green again when homing, but if I halt it first before homing it works as expected. If I halt it once, it seems to stay halted unless the cnc messes up and I have to power the KFlop off/on to fix the glitch. Then the #1 thread become active again.


        Since bit_log_sLimit.c also includes all of these:

        include "KMotionDef.h"
        #include "defines.h"
        #include "pthread.h"
        #include "util.h"
        #include "..\k2_settings.h"
        Do you think the problem lies in the .c program or one of the .h programs?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 20, 2016 1:53:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13635 From: Robert Taormina Date: 7/22/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        I was given the funds to purchase another KFLOP.  Just wanted to let you know.

        I will put the paper work in to our office shortly.


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 21, 2016 4:05:49 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Tom,


        I like the idea of a second KFLOP so that we can experiment freely. I will have to see if I have any budget for it. I assume from the website it's about $249? The cnc seems to work with thread #1 halted.


        I also like the idea of simple. Not truly understanding the pitfalls of the flashed programs maybe we should try putting in a kill thread in the homing program first.  So, are you saying that the programs currently flashed may not be anywhere else on my computer?  Last year we lost everything and re-flashed the KFLOP with the programs that I previously listed. So, maybe I lost what we needed then. But with that said, maybe I did not do it correctly and maybe programs were still on it?  Just as a recap, I remember loading programs 1-6 into the threads and then save, compile, download, run. Then went to config/flash and hit flash user memory. I think I then had to disconnect the computer form the KFLOP and cycle the power.  I should say, I was not using the cnc before this and so I could not attest to how it ran before.


        Tom,  I still have some other issues with the machine. I know, one problem at a time, but just in case these problems are related I wanted to mention them.

        #1 The spindle speed is stuck on one speed. It bounces around from 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I can change the spindle to manual and it works in manual so I don't think its the VFD)

        #2 The GUI Feed override and Speed override do not respond. Nether does entering a speed manual line at the bottom of the GUI.

        #3 I noticed that the K2_Driver.c in thread #6 lists Thread number #4 as having ToolChange.c not SetStepPulseLencth.c which is what looks to be what I have in mine.

        #4 I also noticed that there is a homing program that is listed in thread #5 which is different than the homing program under the user buttons. Do you think one of these may be the wrong Homing program? I have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that it should be homing.c.  I'm wondering if last year I flashed the wrong homing program into the KFLOP?


        The instructor last year using this said he used to be able to change the speed as well as the feed rate override. 


        Also, I'm using 432 version. Most likely not but, could any of these issue be related to this version and would it be best to flash the new version?


        Thanks and sorry for all the questions, I just want to give you as much information as I can.

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 21, 2016 2:00:20 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Thanks the the good descriptions.

        I believe that makes sense. Here is how I'm thinking K2CNC arranged things and what is happening:

        #1 Thread #6 has the "Driver" program Flashed and configured to run on startup

        #2 Thread #1 has the "Jog Limits" program Flashed

        #3 On Power UP the Driver program initializes things then tells Thread #1 to execute

        #4 Your Home program (the one we've been adding printf's in) is configured in KMotionCNC to load/run in Thread #2

        #5 At the end of the Home Program after Homing is complete it sets some flags/variables.  The running Thread #1 sees these flags and for whatever reason decides it should begin Jogging the A Axis.


        The "Jog Limits" program in Thread #1 seems very complex.  I don't really have time to analyze it.  It seems to even use SPI to communicate with something else to get I/O.  Maybe Jog Joysticks?  Buttons?

        Does everything seem to still function with Thread #1 Halted?


        Here are some ideas:

        #1 it would be easy to add a statement to Kill Thread #1 from your Home Program. PauseThread(1);

        #2 Looks like Jogging  Thread #1 may be disabled while the Homing Flag is set?  Maybe leave it set permanently.

        #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the problem.  The risk here is once you change what is flashed in KFLOP there is no way to restore it if you don't know exactly what needs to be put back.  If you make a mistake you might end up dead in the water.  A spare KFLOP would allow you to experiment without altering the original KFLOP.

        There is a way to experiment putting new programs into Threads #1 and #6 without re-Flashing.  You can halt all threads.  Then Compile/Download new programs to them.  Then Execute #6.  In this way you could see if the changed programs cause things to now behave properly.  But the risk is that the new programs might cause everything to work correctly but be missing something that the original programs Flashed in KFLOP did.  So then if flashed in by themselves would not work correctly.

        HTH

        Regards

        TK




        On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Thread #1 seemed to be the culprit. When I push halt before I home then all homes perfectly.


        What I see in the axis screen is #0-#5 have a check in "Enabled", the "Done" box have checks for the same numbers but they are shaded out. When I start the home program #2 starts homing first, the "done" stays shaded but unchecks and the Dest/Postion both increase first, then decreases to a small negative number and then drifts to zero and stops. This then happens the same way for #0, then#2, then#3.  Numbers #4and #5 do nothing but "Enabled" is checked and #6 and #7 do nothing, and nothing is checked but Dest is at "0" and Position stays at "1".


        Taking your clue of looking at which thread is green, I noticed that both 1 and 2 thread highlight when the homing is activated. But now that I've halted #1 only #2 is green and it turns off when the homing program stops.  I also noticed that if I power off/on thread #1 turns green again when homing, but if I halt it first before homing it works as expected. If I halt it once, it seems to stay halted unless the cnc messes up and I have to power the KFlop off/on to fix the glitch. Then the #1 thread become active again.


        Since bit_log_sLimit.c also includes all of these:

        include "KMotionDef.h"
        #include "defines.h"
        #include "pthread.h"
        #include "util.h"
        #include "..\k2_settings.h"
        Do you think the problem lies in the .c program or one of the .h programs?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 20, 2016 1:53:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13653 From: Robert Taormina Date: 7/29/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        I received the new KFLOP this week.  Before I pull out the old one I was wondering if you could give me a list of what files/settings I will need to save before replacing it?  I assume I will need to save and reload the settings for all the ac servo drives/motors.


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 22, 2016 4:01:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Tom,


        I was given the funds to purchase another KFLOP.  Just wanted to let you know.

        I will put the paper work in to our office shortly.


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Robert Taormina robert.taormina@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 21, 2016 4:05:49 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Tom,


        I like the idea of a second KFLOP so that we can experiment freely. I will have to see if I have any budget for it. I assume from the website it's about $249? The cnc seems to work with thread #1 halted.


        I also like the idea of simple. Not truly understanding the pitfalls of the flashed programs maybe we should try putting in a kill thread in the homing program first.  So, are you saying that the programs currently flashed may not be anywhere else on my computer?  Last year we lost everything and re-flashed the KFLOP with the programs that I previously listed. So, maybe I lost what we needed then. But with that said, maybe I did not do it correctly and maybe programs were still on it?  Just as a recap, I remember loading programs 1-6 into the threads and then save, compile, download, run. Then went to config/flash and hit flash user memory. I think I then had to disconnect the computer form the KFLOP and cycle the power.  I should say, I was not using the cnc before this and so I could not attest to how it ran before.


        Tom,  I still have some other issues with the machine. I know, one problem at a time, but just in case these problems are related I wanted to mention them.

        #1 The spindle speed is stuck on one speed. It bounces around from 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I can change the spindle to manual and it works in manual so I don't think its the VFD)

        #2 The GUI Feed override and Speed override do not respond. Nether does entering a speed manual line at the bottom of the GUI.

        #3 I noticed that the K2_Driver.c in thread #6 lists Thread number #4 as having ToolChange.c not SetStepPulseLencth.c which is what looks to be what I have in mine.

        #4 I also noticed that there is a homing program that is listed in thread #5 which is different than the homing program under the user buttons. Do you think one of these may be the wrong Homing program? I have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that it should be homing.c.  I'm wondering if last year I flashed the wrong homing program into the KFLOP?


        The instructor last year using this said he used to be able to change the speed as well as the feed rate override. 


        Also, I'm using 432 version. Most likely not but, could any of these issue be related to this version and would it be best to flash the new version?


        Thanks and sorry for all the questions, I just want to give you as much information as I can.

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Thursday, July 21, 2016 2:00:20 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Thanks the the good descriptions.

        I believe that makes sense. Here is how I'm thinking K2CNC arranged things and what is happening:

        #1 Thread #6 has the "Driver" program Flashed and configured to run on startup

        #2 Thread #1 has the "Jog Limits" program Flashed

        #3 On Power UP the Driver program initializes things then tells Thread #1 to execute

        #4 Your Home program (the one we've been adding printf's in) is configured in KMotionCNC to load/run in Thread #2

        #5 At the end of the Home Program after Homing is complete it sets some flags/variables.  The running Thread #1 sees these flags and for whatever reason decides it should begin Jogging the A Axis.


        The "Jog Limits" program in Thread #1 seems very complex.  I don't really have time to analyze it.  It seems to even use SPI to communicate with something else to get I/O.  Maybe Jog Joysticks?  Buttons?

        Does everything seem to still function with Thread #1 Halted?


        Here are some ideas:

        #1 it would be easy to add a statement to Kill Thread #1 from your Home Program. PauseThread(1);

        #2 Looks like Jogging  Thread #1 may be disabled while the Homing Flag is set?  Maybe leave it set permanently.

        #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the problem.  The risk here is once you change what is flashed in KFLOP there is no way to restore it if you don't know exactly what needs to be put back.  If you make a mistake you might end up dead in the water.  A spare KFLOP would allow you to experiment without altering the original KFLOP.

        There is a way to experiment putting new programs into Threads #1 and #6 without re-Flashing.  You can halt all threads.  Then Compile/Download new programs to them.  Then Execute #6.  In this way you could see if the changed programs cause things to now behave properly.  But the risk is that the new programs might cause everything to work correctly but be missing something that the original programs Flashed in KFLOP did.  So then if flashed in by themselves would not work correctly.

        HTH

        Regards

        TK




        On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Thread #1 seemed to be the culprit. When I push halt before I home then all homes perfectly.


        What I see in the axis screen is #0-#5 have a check in "Enabled", the "Done" box have checks for the same numbers but they are shaded out. When I start the home program #2 starts homing first, the "done" stays shaded but unchecks and the Dest/Postion both increase first, then decreases to a small negative number and then drifts to zero and stops. This then happens the same way for #0, then#2, then#3.  Numbers #4and #5 do nothing but "Enabled" is checked and #6 and #7 do nothing, and nothing is checked but Dest is at "0" and Position stays at "1".


        Taking your clue of looking at which thread is green, I noticed that both 1 and 2 thread highlight when the homing is activated. But now that I've halted #1 only #2 is green and it turns off when the homing program stops.  I also noticed that if I power off/on thread #1 turns green again when homing, but if I halt it first before homing it works as expected. If I halt it once, it seems to stay halted unless the cnc messes up and I have to power the KFlop off/on to fix the glitch. Then the #1 thread become active again.


        Since bit_log_sLimit.c also includes all of these:

        include "KMotionDef.h"
        #include "defines.h"
        #include "pthread.h"
        #include "util.h"
        #include "..\k2_settings.h"
        Do you think the problem lies in the .c program or one of the .h programs?


        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, July 20, 2016 1:53:53 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        It looks like Axis #3 has an encoder and it is counting correctly as the Destination and Position nearly match.

        It would have been helpful if you described what happens on the Axis Screen throughout the Homing sequence.

        All I can think of is that some other program is running and after Homing is complete decides to move the A axis for some reason.

        From earlier posts I'm guessing

        Driver\bitJog_sLimit.c

        is flashed into Thread #1 and is running.  Was that file originally loaded into the KMotion.exe Thread #1 editor?  If you go to KMotion.exe C Programs screen do you see a green bar on Thread #1 indicating a program is running?  If so try selecting Thread #1 and push Halt.  Does the Green bar go away?  Does Homing still work?  Does A still Drift?

        Regards
        TK


        On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        See attached for png files. If you need jpeg I'll resend.


        I watched the Axis screen and each axis zeroed but after #3 zeroed it then drifted positive and kept going. I hit pause to stop it from turning.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Tuesday, July 19, 2016 1:39:17 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        C Functions exit and return to where they were called either at the end of the function or when they are told to return.

        Strange there is drift positive as the Home program tells the motion to stop.  Maybe the axis is configured as closed loop and is trying to correct an error?

        I'm assuming that the A Axis is axis #3

        As the Axis is drifting go to the KMotion.exe Axis screen and observe the Axis #3 Dest and Position and tell us what they are doing.

        Also go to the Config/Flash Screen, select Axis Channel #3, Push Upload to upload the current configuration to the Screen, then post a screen shot for us to look at.

        Regards

        TK



        On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        Yes, it took me a bit to understand that it had to be before the function return. At first I thought it only had to be the last line before the bracket.


        So, to answer your question, Yes the A axis drifts positive after it backs up at the limit switch.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, July 18, 2016 6:43:24 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        ok Great.  I assume you understand now why putting it after the function return would never execute.

        So we now know for sure what code is actually being executed and that the function enters and exits for all 4 axes including A.  Does the A Axis still home and then drift positive as you describe before?

        Regards

        TK



        On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I moved the printf("Exiting Home_Single now\n"); around just to see where it would print and found that if I put it just before the "return 1; then it will print printf("Exiting Home_Single now\n"); as well as Entering.


        Robert


        From: Robert Taormina
        Sent: Monday, July 18, 2016 9:55:19 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         

        Good Morning Tom,


        Thanks for the bracketing help. I think I put the printf in the correct place now.  The "entering home" printed 4 times but the "exit home" did not print. It printed every time it started to home an axis. I expected to see some sort of number after each print message because of the "\n" (just a guess) but this did not happen. It looked like this:

        Mon, Jul 18, 2016, 09:31:08  KMotion Program Started
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now
        Entering Home_Single now

        Here is where I placed the commands:

        #include "KMotionDef.h"
        #include "Driver\Defines.c

        int Home_Single(int axis, int sw int Multiplier)
        {
            printf("Entering Home_Single now\n");
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
            printf("Exiting Home_Single now\n");
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }

        Thanks,

        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Saturday, July 16, 2016 1:52:32 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        You didn't put the printf statements within the Home_Single function so they will never execute.  I know that C code probably looks totally nonsensical to you now but after learning several simple concepts it will quickly become readable.  Please read this recent post and see if you are then able to put the printfs inside the Home_Single function:

        http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546

        Regards

        TK



        On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        I opened the notebook++ and opened the homing program that I am using under an existing home button. I cut and pasted the first printf line in line #3 and the second one in line # 56. I then saved it, restarted the cnc and homed the cnc.  I look into the console to see if anything printed and saw nothing.

        Here is the program with printf added.

        #include "KMotionDef.h"
        #include "Driver\Defines.c
        printf("Entering Home_Single now\n");
        int Home_Single(int axis, int sw int Multiplier)
        {
            int index_last;
            int index_this;
            int home_vel = Multiplier * 18000;
            int backup_vel = Multiplier * -2000;
            double savepos;

            Jog(axis, home_vel);        

            while (ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }

            Jog(axis,0);                  // StopMotion
            while(!CheckDone(axis)) ;
            Jog(axis, backup_vel);        
            while (!ReadBit(sw)) // wait for switch to change
            {
                Delay_sec(.001);    // little delay for debounce
                if (CheckDone(axis))
                    break;
            }
            savepos = chan[axis].Position;
            Jog(axis,0);                  // StopMotion
            Move(axis,savepos);
            
            while (!CheckDone(axis)) ;

            Delay_sec(.3);
            Zero(axis);
            Delay_sec(.1);
            
            return 1;
        }

        int main()
        {
            SetBit(Homing);
            ClearBit(CHECK_SOFT_LIMT);
            Home_Single(Z, pZ_SW, 1);
            Home_Single(X, pX_SW, 1);
            Home_Single(Y, pY_SW, 1);
            Home_Single(A, pA_SW, 1);
            ClearBit(Homing);
            SetBit(CHECK_SOFT_LIMT);
            return 0;
        }
        printf("Exiting Home_Single now\n");


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 4:00:06 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        No.  If you put a printf into a program, assign that program to a button, and push the button something should print.  Let's focus on getting that to work before doing anything else.  Let's repeat that experiment.  If it doesn't work explain in great detail what you are doing so we can try to figure out what is going wrong.

        Regards

        TK


        On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, so I've saved the variables. 

        You had asked that I put the printf lines in the Homing program.  I tried it with the program that I have listed under the buttons and nothing seemed to happen. But then you mentioned that I needed to flash it which got me thinking that their may be another Homing program in the Kflop. Which homing program, the one under the button or the one in Kflop thread should I have altered? I assume if it was the one under the button I would not have to flash it. If it's the program in the Kflop then I would have to flash it.  The file in the Kflop is Homing_zxy.c and I don't believe I sent you this file.

        Should I send you the files that I think are flashed in the KFlop threads?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Friday, July 15, 2016 3:04:15 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        The Send line isn't important. That is just the last Console Command
        someone issued to KFLOP.

        To put those back you could write a C Program to read that file and put
        those back. Or just manually set them with Console Commands (ie
        SetPersistDec). Let's not worry about that until if/when the issue
        comes up. The important thing is that the data is backed up.

        Those are User Variables. Unfortunately there isn't a means of reading
        programs out of KFLOP (KFLOP only contains the binary data). If you
        were to study the K2CNC programs you could see what all those variables
        were used for.

        Regards
        TK

        On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > OK, see below for what was in the console. I will save that as a tx
        > file. In the "send" line it says Zero2. Is this important? In the
        > future, how would I put this back into the KFLOP? I was expecting to
        > see a list of programs that are currently in the KFLOP.
        >
        > Robert
        >
        > Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        > 0 = 12
        > 1 = 0
        > 2 = 0
        > 3 = 0
        > 4 = 0
        > 5 = 0
        > 6 = 0
        > 7 = 54321
        > 8 = 2
        > 9 = 204
        > 10 = 0
        > 11 = 7
        > 12 = 0
        > 13 = 7
        > 14 = 0
        > 15 = 0
        > 16 = 0
        > 17 = 0
        > 18 = 0
        > 19 = 0
        > 20 = 0
        > 21 = 0
        > 22 = 0
        > 23 = 0
        > 24 = 0
        > 25 = 0
        > 26 = 0
        > 27 = 0
        > 28 = 0
        > 29 = 0
        > 30 = 0
        > 31 = 1176256512
        > 32 = 0
        > 33 = 0
        > 34 = 0
        > 35 = 0
        > 36 = 0
        > 37 = 0
        > 38 = 0
        > 39 = 0
        > 40 = 20000
        > 41 = 30000
        > 42 = 50000
        > 43 = 0
        > 44 = 0
        > 45 = -1
        > 46 = -1
        > 47 = 0
        > 48 = 0
        > 49 = 0
        > 50 = 20000
        > 51 = 20000
        > 52 = 20000
        > 53 = 20000
        > 54 = 5000
        > 55 = 5000
        > 56 = 0
        > 57 = 0
        > 58 = 0
        > 59 = 0
        > 60 = 0
        > 61 = 0
        > 62 = 0
        > 63 = 0
        > 64 = 0
        > 65 = 0
        > 66 = 0
        > 67 = 0
        > 68 = 0
        > 69 = 0
        > 70 = 0
        > 71 = 0
        > 72 = 0
        > 73 = 0
        > 74 = 0
        > 75 = 0
        > 76 = 0
        > 77 = 0
        > 78 = 0
        > 79 = 0
        > 80 = 0
        > 81 = 0
        > 82 = 0
        > 83 = 0
        > 84 = 0
        > 85 = 0
        > 86 = 0
        > 87 = 0
        > 88 = 0
        > 89 = 0
        > 90 = 0
        > 91 = 0
        > 92 = 0
        > 93 = 0
        > 94 = 0
        > 95 = 0
        > 96 = 0
        > 97 = 0
        > 98 = 0
        > 99 = 0
        > 100 = 0
        > 101 = 0
        > 102 = 0
        > 103 = 0
        > 104 = 0
        > 105 = 0
        > 106 = 0
        > 107 = 0
        > 108 = 0
        > 109 = 0
        > 110 = 0
        > 111 = 0
        > 112 = 0
        > 113 = 0
        > 114 = 0
        > 115 = 0
        > 116 = 0
        > 117 = 0
        > 118 = 0
        > 119 = 0
        > 120 = 0
        > 121 = 1087950336
        > 122 = 0
        > 123 = 1087950336
        > 124 = 0
        > 125 = 1087950336
        > 126 = 0
        > 127 = 1086556160
        > 128 = 0
        > 129 = 1086556160
        > 130 = 0
        > 131 = 1086556160
        > 132 = 0
        > 133 = -1070071808
        > 134 = -1717986918
        > 135 = 1068079513
        > 136 = 0
        > 137 = -1069318144
        > 138 = -1717986918
        > 139 = 1069128089
        > 140 = 0
        > 141 = -1071906816
        > 142 = 0
        > 143 = 0
        > 144 = 0
        > 145 = -1053916032
        > 146 = 0
        > 147 = 1093567616
        > 148 = 0
        > 149 = -1053916032
        > 150 = 0
        > 151 = 1093567616
        > 152 = 0
        > 153 = -1053916032
        > 154 = 0
        > 155 = 1093567616
        > 156 = 0
        > 157 = 0
        > 158 = 0
        > 159 = 0
        > 160 = 0
        > 161 = 0
        > 162 = 0
        > 163 = 0
        > 164 = 0
        > 165 = 0
        > 166 = 0
        > 167 = 0
        > 168 = 0
        > 169 = 0
        > 170 = 0
        > 171 = 0
        > 172 = 0
        > 173 = 0
        > 174 = 0
        > 175 = 0
        > 176 = 0
        > 177 = 0
        > 178 = 0
        > 179 = 0
        > 180 = 0
        > 181 = 0
        > 182 = 0
        > 183 = 0
        > 184 = 0
        > 185 = 0
        > 186 = 0
        > 187 = 0
        > 188 = 0
        > 189 = 0
        > 190 = 0
        > 191 = 0
        > 192 = 0
        > 193 = 0
        > 194 = 0
        > 195 = 0
        > 196 = 0
        > 197 = 0
        > 198 = 0
        > 199 = 0
        >

        Group: DynoMotion Message: 13661 From: TKSOFT Date: 8/1/2016
        Subject: Re: z-touch glitch?
        Hi Robert,

        I think we have everything - the persist variable settings and a guess
        at the flashed programs.

        The persist variable printout needs to be reformatted to easily set all
        the variables. The format needs to be changed from this format:

        153 = -1053916032

        to this format:

        persist.UserData[153] = -1053916032;

        You should be able to do that with a text editor. Or we should have
        printed them out that way with:

        printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);

        Can you do this?

        Regards
        TK




        On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > I received the new KFLOP this week. Before I pull out the old one I
        > was wondering if you could give me a list of what files/settings I
        > will need to save before replacing it? I assume I will need to save
        > and reload the settings for all the ac servo drives/motors.
        >
        > Thanks,
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Robert Taormina robert.taormina@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Friday, July 22, 2016 4:01:53 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Tom,
        >
        > I was given the funds to purchase another KFLOP. Just wanted to let
        > you know.
        >
        > I will put the paper work in to our office shortly.
        >
        > Thanks,
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Robert Taormina robert.taormina@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Thursday, July 21, 2016 4:05:49 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Tom,
        >
        > I like the idea of a second KFLOP so that we can experiment freely. I
        > will have to see if I have any budget for it. I assume from the
        > website it's about $249? The cnc seems to work with thread #1 halted.
        >
        > I also like the idea of simple. Not truly understanding the pitfalls
        > of the flashed programs maybe we should try putting in a kill thread
        > in the homing program first. So, are you saying that the programs
        > currently flashed may not be anywhere else on my computer? Last year
        > we lost everything and re-flashed the KFLOP with the programs that I
        > previously listed. So, maybe I lost what we needed then. But with that
        > said, maybe I did not do it correctly and maybe programs were still on
        > it? Just as a recap, I remember loading programs 1-6 into the threads
        > and then save, compile, download, run. Then went to config/flash and
        > hit flash user memory. I think I then had to disconnect the computer
        > form the KFLOP and cycle the power. I should say, I was not using the
        > cnc before this and so I could not attest to how it ran before.
        >
        > Tom, I still have some other issues with the machine. I know, one
        > problem at a time, but just in case these problems are related I
        > wanted to mention them.
        >
        > #1 The spindle speed is stuck on one speed. It bounces around from
        > 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I can
        > change the spindle to manual and it works in manual so I don't think
        > its the VFD)
        >
        > #2 The GUI Feed override and Speed override do not respond. Nether
        > does entering a speed manual line at the bottom of the GUI.
        >
        > #3 I noticed that the K2_Driver.c in thread #6 lists Thread number #4
        > as having ToolChange.c not SetStepPulseLencth.c which is what looks to
        > be what I have in mine.
        >
        > #4 I also noticed that there is a homing program that is listed in
        > thread #5 which is different than the homing program under the user
        > buttons. Do you think one of these may be the wrong Homing program? I
        > have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that
        > it should be homing.c. I'm wondering if last year I flashed the wrong
        > homing program into the KFLOP?
        >
        > The instructor last year using this said he used to be able to change
        > the speed as well as the feed rate override.
        >
        > Also, I'm using 432 version. Most likely not but, could any of these
        > issue be related to this version and would it be best to flash the new
        > version?
        >
        > Thanks and sorry for all the questions, I just want to give you as
        > much information as I can.
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Tom Kerekes tk@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Thursday, July 21, 2016 2:00:20 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > Thanks the the good descriptions.
        >
        > I believe that makes sense. Here is how I'm thinking K2CNC arranged
        > things and what is happening:
        >
        > #1 Thread #6 has the "Driver" program Flashed and configured to run on
        > startup
        >
        > #2 Thread #1 has the "Jog Limits" program Flashed
        >
        > #3 On Power UP the Driver program initializes things then tells Thread
        > #1 to execute
        >
        > #4 Your Home program (the one we've been adding printf's in) is
        > configured in KMotionCNC to load/run in Thread #2
        >
        > #5 At the end of the Home Program after Homing is complete it sets
        > some flags/variables. The running Thread #1 sees these flags and for
        > whatever reason decides it should begin Jogging the A Axis.
        >
        > The "Jog Limits" program in Thread #1 seems very complex. I don't
        > really have time to analyze it. It seems to even use SPI to
        > communicate with something else to get I/O. Maybe Jog Joysticks?
        > Buttons?
        >
        > Does everything seem to still function with Thread #1 Halted?
        >
        > Here are some ideas:
        >
        > #1 it would be easy to add a statement to Kill Thread #1 from your
        > Home Program. PauseThread(1);
        >
        > #2 Looks like Jogging Thread #1 may be disabled while the Homing Flag
        > is set? Maybe leave it set permanently.
        >
        > #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the
        > problem. The risk here is once you change what is flashed in KFLOP
        > there is no way to restore it if you don't know exactly what needs to
        > be put back. If you make a mistake you might end up dead in the
        > water. A spare KFLOP would allow you to experiment without altering
        > the original KFLOP.
        >
        > There is a way to experiment putting new programs into Threads #1 and
        > #6 without re-Flashing. You can halt all threads. Then
        > Compile/Download new programs to them. Then Execute #6. In this way
        > you could see if the changed programs cause things to now behave
        > properly. But the risk is that the new programs might cause
        > everything to work correctly but be missing something that the
        > original programs Flashed in KFLOP did. So then if flashed in by
        > themselves would not work correctly.
        >
        > HTH
        >
        > Regards
        >
        > TK
        >
        > On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >
        >> Hi Tom,
        >>
        >> Thread #1 seemed to be the culprit. When I push halt before I home
        >> then all homes perfectly.
        >>
        >> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >> the "Done" box have checks for the same numbers but they are shaded
        >> out. When I start the home program #2 starts homing first, the
        >> "done" stays shaded but unchecks and the Dest/Postion both increase
        >> first, then decreases to a small negative number and then drifts to
        >> zero and stops. This then happens the same way for #0, then#2,
        >> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and #6
        >> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >> Position stays at "1".
        >>
        >> Taking your clue of looking at which thread is green, I noticed that
        >> both 1 and 2 thread highlight when the homing is activated. But now
        >> that I've halted #1 only #2 is green and it turns off when the
        >> homing program stops. I also noticed that if I power off/on thread
        >> #1 turns green again when homing, but if I halt it first before
        >> homing it works as expected. If I halt it once, it seems to stay
        >> halted unless the cnc messes up and I have to power the KFlop off/on
        >> to fix the glitch. Then the #1 thread become active again.
        >>
        >> Since bit_log_sLimit.c also includes all of these:
        >>
        >> include "KMotionDef.h"
        >> #include "defines.h"
        >> #include "pthread.h"
        >> #include "util.h"
        >> #include "..\k2_settings.h" Do you think the problem lies in the .c
        >> program or one of the .h programs?
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> It looks like Axis #3 has an encoder and it is counting correctly as
        >> the Destination and Position nearly match.
        >>
        >> It would have been helpful if you described what happens on the Axis
        >> Screen throughout the Homing sequence.
        >>
        >> All I can think of is that some other program is running and after
        >> Homing is complete decides to move the A axis for some reason.
        >>
        >> From earlier posts I'm guessing
        >>
        >> Driver\bitJog_sLimit.c
        >> is flashed into Thread #1 and is running. Was that file originally
        >> loaded into the KMotion.exe Thread #1 editor? If you go to
        >> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >> indicating a program is running? If so try selecting Thread #1 and
        >> push Halt. Does the Green bar go away? Does Homing still work?
        >> Does A still Drift?
        >>
        >> Regards
        >> TK
        >>
        >> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> See attached for png files. If you need jpeg I'll resend.
        >>
        >> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >> it then drifted positive and kept going. I hit pause to stop it from
        >> turning.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> C Functions exit and return to where they were called either at the
        >> end of the function or when they are told to return.
        >>
        >> Strange there is drift positive as the Home program tells the motion
        >> to stop. Maybe the axis is configured as closed loop and is trying
        >> to correct an error?
        >>
        >> I'm assuming that the A Axis is axis #3
        >>
        >> As the Axis is drifting go to the KMotion.exe Axis screen and
        >> observe the Axis #3 Dest and Position and tell us what they are
        >> doing.
        >>
        >> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >> Upload to upload the current configuration to the Screen, then post
        >> a screen shot for us to look at.
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> Yes, it took me a bit to understand that it had to be before the
        >> function return. At first I thought it only had to be the last line
        >> before the bracket.
        >>
        >> So, to answer your question, Yes the A axis drifts positive after it
        >> backs up at the limit switch.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Monday, July 18, 2016 6:43:24 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> ok Great. I assume you understand now why putting it after the
        >> function return would never execute.
        >>
        >> So we now know for sure what code is actually being executed and
        >> that the function enters and exits for all 4 axes including A. Does
        >> the A Axis still home and then drift positive as you describe
        >> before?
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> I moved the printf("Exiting Home_Single now\n"); around just to see
        >> where it would print and found that if I put it just before the
        >> "return 1; then it will print printf("Exiting Home_Single now\n");
        >> as well as Entering.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: Robert Taormina
        >> SENT: Monday, July 18, 2016 9:55:19 AM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Good Morning Tom,
        >>
        >> Thanks for the bracketing help. I think I put the printf in the
        >> correct place now. The "entering home" printed 4 times but the
        >> "exit home" did not print. It printed every time it started to home
        >> an axis. I expected to see some sort of number after each print
        >> message because of the "\n" (just a guess) but this did not happen.
        >> It looked like this:
        >>
        >> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >> Entering Home_Single now
        >> Entering Home_Single now
        >> Entering Home_Single now
        >> Entering Home_Single now
        >>
        >> Here is where I placed the commands:
        >>
        >> #include "KMotionDef.h"
        >> #include "Driver\Defines.c
        >>
        >> int Home_Single(int axis, int sw int Multiplier)
        >> {
        >> printf("Entering Home_Single now\n");
        >> int index_last;
        >> int index_this;
        >> int home_vel = Multiplier * 18000;
        >> int backup_vel = Multiplier * -2000;
        >> double savepos;
        >>
        >> Jog(axis, home_vel);
        >>
        >> while (ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >>
        >> Jog(axis,0); // StopMotion
        >> while(!CheckDone(axis)) ;
        >> Jog(axis, backup_vel);
        >> while (!ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >> savepos = chan[axis].Position;
        >> Jog(axis,0); // StopMotion
        >> Move(axis,savepos);
        >>
        >> while (!CheckDone(axis)) ;
        >>
        >> Delay_sec(.3);
        >> Zero(axis);
        >> Delay_sec(.1);
        >>
        >> return 1;
        >> printf("Exiting Home_Single now\n");
        >> }
        >>
        >> int main()
        >> {
        >> SetBit(Homing);
        >> ClearBit(CHECK_SOFT_LIMT);
        >> Home_Single(Z, pZ_SW, 1);
        >> Home_Single(X, pX_SW, 1);
        >> Home_Single(Y, pY_SW, 1);
        >> Home_Single(A, pA_SW, 1);
        >> ClearBit(Homing);
        >> SetBit(CHECK_SOFT_LIMT);
        >> return 0;
        >> }
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Saturday, July 16, 2016 1:52:32 AM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> You didn't put the printf statements within the Home_Single function
        >> so they will never execute. I know that C code probably looks
        >> totally nonsensical to you now but after learning several simple
        >> concepts it will quickly become readable. Please read this recent
        >> post and see if you are then able to put the printfs inside the
        >> Home_Single function:
        >>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> I opened the notebook++ and opened the homing program that I am
        >> using under an existing home button. I cut and pasted the first
        >> printf line in line #3 and the second one in line # 56. I then saved
        >> it, restarted the cnc and homed the cnc. I look into the console to
        >> see if anything printed and saw nothing.
        >>
        >> Here is the program with printf added.
        >> #include "KMotionDef.h"
        >> #include "Driver\Defines.c
        >> printf("Entering Home_Single now\n");
        >> int Home_Single(int axis, int sw int Multiplier)
        >> {
        >> int index_last;
        >> int index_this;
        >> int home_vel = Multiplier * 18000;
        >> int backup_vel = Multiplier * -2000;
        >> double savepos;
        >>
        >> Jog(axis, home_vel);
        >>
        >> while (ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >>
        >> Jog(axis,0); // StopMotion
        >> while(!CheckDone(axis)) ;
        >> Jog(axis, backup_vel);
        >> while (!ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >> savepos = chan[axis].Position;
        >> Jog(axis,0); // StopMotion
        >> Move(axis,savepos);
        >>
        >> while (!CheckDone(axis)) ;
        >>
        >> Delay_sec(.3);
        >> Zero(axis);
        >> Delay_sec(.1);
        >>
        >> return 1;
        >> }
        >>
        >> int main()
        >> {
        >> SetBit(Homing);
        >> ClearBit(CHECK_SOFT_LIMT);
        >> Home_Single(Z, pZ_SW, 1);
        >> Home_Single(X, pX_SW, 1);
        >> Home_Single(Y, pY_SW, 1);
        >> Home_Single(A, pA_SW, 1);
        >> ClearBit(Homing);
        >> SetBit(CHECK_SOFT_LIMT);
        >> return 0;
        >> }
        >> printf("Exiting Home_Single now\n");
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 15, 2016 4:00:06 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> No. If you put a printf into a program, assign that program to a
        >> button, and push the button something should print. Let's focus on
        >> getting that to work before doing anything else. Let's repeat that
        >> experiment. If it doesn't work explain in great detail what you are
        >> doing so we can try to figure out what is going wrong.
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> OK, so I've saved the variables.
        >>
        >> You had asked that I put the printf lines in the Homing program. I
        >> tried it with the program that I have listed under the buttons and
        >> nothing seemed to happen. But then you mentioned that I needed to
        >> flash it which got me thinking that their may be another Homing
        >> program in the Kflop. Which homing program, the one under the button
        >> or the one in Kflop thread should I have altered? I assume if it was
        >> the one under the button I would not have to flash it. If it's the
        >> program in the Kflop then I would have to flash it. The file in the
        >> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>
        >> Should I send you the files that I think are flashed in the KFlop
        >> threads?
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 15, 2016 3:04:15 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> The Send line isn't important. That is just the last Console Command
        >>
        >> someone issued to KFLOP.
        >>
        >> To put those back you could write a C Program to read that file and
        >> put
        >> those back. Or just manually set them with Console Commands (ie
        >> SetPersistDec). Let's not worry about that until if/when the issue
        >> comes up. The important thing is that the data is backed up.
        >>
        >> Those are User Variables. Unfortunately there isn't a means of
        >> reading
        >> programs out of KFLOP (KFLOP only contains the binary data). If you
        >> were to study the K2CNC programs you could see what all those
        >> variables
        >> were used for.
        >>
        >> Regards
        >> TK
        >>
        >> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>> Hi Tom,
        >>>
        >>> OK, see below for what was in the console. I will save that as a
        >> tx
        >>> file. In the "send" line it says Zero2. Is this important? In the
        >>> future, how would I put this back into the KFLOP? I was expecting
        >> to
        >>> see a list of programs that are currently in the KFLOP.
        >>>
        >>> Robert
        >>>
        >>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>> 0 = 12
        >>> 1 = 0
        >>> 2 = 0
        >>> 3 = 0
        >>> 4 = 0
        >>> 5 = 0
        >>> 6 = 0
        >>> 7 = 54321
        >>> 8 = 2
        >>> 9 = 204
        >>> 10 = 0
        >>> 11 = 7
        >>> 12 = 0
        >>> 13 = 7
        >>> 14 = 0
        >>> 15 = 0
        >>> 16 = 0
        >>> 17 = 0
        >>> 18 = 0
        >>> 19 = 0
        >>> 20 = 0
        >>> 21 = 0
        >>> 22 = 0
        >>> 23 = 0
        >>> 24 = 0
        >>> 25 = 0
        >>> 26 = 0
        >>> 27 = 0
        >>> 28 = 0
        >>> 29 = 0
        >>> 30 = 0
        >>> 31 = 1176256512
        >>> 32 = 0
        >>> 33 = 0
        >>> 34 = 0
        >>> 35 = 0
        >>> 36 = 0
        >>> 37 = 0
        >>> 38 = 0
        >>> 39 = 0
        >>> 40 = 20000
        >>> 41 = 30000
        >>> 42 = 50000
        >>> 43 = 0
        >>> 44 = 0
        >>> 45 = -1
        >>> 46 = -1
        >>> 47 = 0
        >>> 48 = 0
        >>> 49 = 0
        >>> 50 = 20000
        >>> 51 = 20000
        >>> 52 = 20000
        >>> 53 = 20000
        >>> 54 = 5000
        >>> 55 = 5000
        >>> 56 = 0
        >>> 57 = 0
        >>> 58 = 0
        >>> 59 = 0
        >>> 60 = 0
        >>> 61 = 0
        >>> 62 = 0
        >>> 63 = 0
        >>> 64 = 0
        >>> 65 = 0
        >>> 66 = 0
        >>> 67 = 0
        >>> 68 = 0
        >>> 69 = 0
        >>> 70 = 0
        >>> 71 = 0
        >>> 72 = 0
        >>> 73 = 0
        >>> 74 = 0
        >>> 75 = 0
        >>> 76 = 0
        >>> 77 = 0
        >>> 78 = 0
        >>> 79 = 0
        >>> 80 = 0
        >>> 81 = 0
        >>> 82 = 0
        >>> 83 = 0
        >>> 84 = 0
        >>> 85 = 0
        >>> 86 = 0
        >>> 87 = 0
        >>> 88 = 0
        >>> 89 = 0
        >>> 90 = 0
        >>> 91 = 0
        >>> 92 = 0
        >>> 93 = 0
        >>> 94 = 0
        >>> 95 = 0
        >>> 96 = 0
        >>> 97 = 0
        >>> 98 = 0
        >>> 99 = 0
        >>> 100 = 0
        >>> 101 = 0
        >>> 102 = 0
        >>> 103 = 0
        >>> 104 = 0
        >>> 105 = 0
        >>> 106 = 0
        >>> 107 = 0
        >>> 108 = 0
        >>> 109 = 0
        >>> 110 = 0
        >>> 111 = 0
        >>> 112 = 0
        >>> 113 = 0
        >>> 114 = 0
        >>> 115 = 0
        >>> 116 = 0
        >>> 117 = 0
        >>> 118 = 0
        >>> 119 = 0
        >>> 120 = 0
        >>> 121 = 1087950336
        >>> 122 = 0
        >>> 123 = 1087950336
        >>> 124 = 0
        >>> 125 = 1087950336
        >>> 126 = 0
        >>> 127 = 1086556160
        >>> 128 = 0
        >>> 129 = 1086556160
        >>> 130 = 0
        >>> 131 = 1086556160
        >>> 132 = 0
        >>> 133 = -1070071808
        >>> 134 = -1717986918
        >>> 135 = 1068079513
        >>> 136 = 0
        >>> 137 = -1069318144
        >>> 138 = -1717986918
        >>> 139 = 1069128089
        >>> 140 = 0
        >>> 141 = -1071906816
        >>> 142 = 0
        >>> 143 = 0
        >>> 144 = 0
        >>> 145 = -1053916032
        >>> 146 = 0
        >>> 147 = 1093567616
        >>> 148 = 0
        >>> 149 = -1053916032
        >>> 150 = 0
        >>> 151 = 1093567616
        >>> 152 = 0
        >>> 153 = -1053916032
        >>> 154 = 0
        >>> 155 = 1093567616
        >>> 156 = 0
        >>> 157 = 0
        >>> 158 = 0
        >>> 159 = 0
        >>> 160 = 0
        >>> 161 = 0
        >>> 162 = 0
        >>> 163 = 0
        >>> 164 = 0
        >>> 165 = 0
        >>> 166 = 0
        >>> 167 = 0
        >>> 168 = 0
        >>> 169 = 0
        >>> 170 = 0
        >>> 171 = 0
        >>> 172 = 0
        >>> 173 = 0
        >>> 174 = 0
        >>> 175 = 0
        >>> 176 = 0
        >>> 177 = 0
        >>> 178 = 0
        >>> 179 = 0
        >>> 180 = 0
        >>> 181 = 0
        >>> 182 = 0
        >>> 183 = 0
        >>> 184 = 0
        >>> 185 = 0
        >>> 186 = 0
        >>> 187 = 0
        >>> 188 = 0
        >>> 189 = 0
        >>> 190 = 0
        >>> 191 = 0
        >>> 192 = 0
        >>> 193 = 0
        >>> 194 = 0
        >>> 195 = 0
        >>> 196 = 0
        >>> 197 = 0
        >>> 198 = 0
        >>> 199 = 0
        >>>
        Group: DynoMotion Message: 13666 From: Robert Taormina Date: 8/3/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        Just to recap, so this is in preparation to change the KFLOP. Right? Can you give me a little more instruction?


        This is what I can see.  If I put this program in thread #7 and run it:

        #include "KMotionDef.h"

        main()
        {
            int i;
            for (i=0;i<200;i++)
                printf("%d = %d\n",i,persist.UserData[i]);

        }
        Then I see a list of numbers in the Console. I can find and see (153 = -1053916032) in the listed numbers. I assume this is the number I should be replacing. I not sure what to do next.


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Monday, August 1, 2016 5:30:41 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        I think we have everything - the persist variable settings and a guess
        at the flashed programs.

        The persist variable printout needs to be reformatted to easily set all
        the variables. The format needs to be changed from this format:

        153 = -1053916032

        to this format:

        persist.UserData[153] = -1053916032;

        You should be able to do that with a text editor. Or we should have
        printed them out that way with:

        printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);

        Can you do this?

        Regards
        TK

        On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:

        > Hi Tom,
        >
        > I received the new KFLOP this week. Before I pull out the old one I
        > was wondering if you could give me a list of what files/settings I
        > will need to save before replacing it? I assume I will need to save
        > and reload the settings for all the ac servo drives/motors.
        >
        > Thanks,
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Robert Taormina robert.taormina@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Friday, July 22, 2016 4:01:53 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Tom,
        >
        > I was given the funds to purchase another KFLOP. Just wanted to let
        > you know.
        >
        > I will put the paper work in to our office shortly.
        >
        > Thanks,
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Robert Taormina robert.taormina@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Thursday, July 21, 2016 4:05:49 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Tom,
        >
        > I like the idea of a second KFLOP so that we can experiment freely. I
        > will have to see if I have any budget for it. I assume from the
        > website it's about $249? The cnc seems to work with thread #1 halted.
        >
        > I also like the idea of simple. Not truly understanding the pitfalls
        > of the flashed programs maybe we should try putting in a kill thread
        > in the homing program first. So, are you saying that the programs
        > currently flashed may not be anywhere else on my computer? Last year
        > we lost everything and re-flashed the KFLOP with the programs that I
        > previously listed. So, maybe I lost what we needed then. But with that
        > said, maybe I did not do it correctly and maybe programs were still on
        > it? Just as a recap, I remember loading programs 1-6 into the threads
        > and then save, compile, download, run. Then went to config/flash and
        > hit flash user memory. I think I then had to disconnect the computer
        > form the KFLOP and cycle the power. I should say, I was not using the
        > cnc before this and so I could not attest to how it ran before.
        >
        > Tom, I still have some other issues with the machine. I know, one
        > problem at a time, but just in case these problems are related I
        > wanted to mention them.
        >
        > #1 The spindle speed is stuck on one speed. It bounces around from
        > 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I can
        > change the spindle to manual and it works in manual so I don't think
        > its the VFD)
        >
        > #2 The GUI Feed override and Speed override do not respond. Nether
        > does entering a speed manual line at the bottom of the GUI.
        >
        > #3 I noticed that the K2_Driver.c in thread #6 lists Thread number #4
        > as having ToolChange.c not SetStepPulseLencth.c which is what looks to
        > be what I have in mine.
        >
        > #4 I also noticed that there is a homing program that is listed in
        > thread #5 which is different than the homing program under the user
        > buttons. Do you think one of these may be the wrong Homing program? I
        > have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that
        > it should be homing.c. I'm wondering if last year I flashed the wrong
        > homing program into the KFLOP?
        >
        > The instructor last year using this said he used to be able to change
        > the speed as well as the feed rate override.
        >
        > Also, I'm using 432 version. Most likely not but, could any of these
        > issue be related to this version and would it be best to flash the new
        > version?
        >
        > Thanks and sorry for all the questions, I just want to give you as
        > much information as I can.
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of Tom Kerekes tk@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        > SENT: Thursday, July 21, 2016 2:00:20 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > Thanks the the good descriptions.
        >
        > I believe that makes sense. Here is how I'm thinking K2CNC arranged
        > things and what is happening:
        >
        > #1 Thread #6 has the "Driver" program Flashed and configured to run on
        > startup
        >
        > #2 Thread #1 has the "Jog Limits" program Flashed
        >
        > #3 On Power UP the Driver program initializes things then tells Thread
        > #1 to execute
        >
        > #4 Your Home program (the one we've been adding printf's in) is
        > configured in KMotionCNC to load/run in Thread #2
        >
        > #5 At the end of the Home Program after Homing is complete it sets
        > some flags/variables. The running Thread #1 sees these flags and for
        > whatever reason decides it should begin Jogging the A Axis.
        >
        > The "Jog Limits" program in Thread #1 seems very complex. I don't
        > really have time to analyze it. It seems to even use SPI to
        > communicate with something else to get I/O. Maybe Jog Joysticks?
        > Buttons?
        >
        > Does everything seem to still function with Thread #1 Halted?
        >
        > Here are some ideas:
        >
        > #1 it would be easy to add a statement to Kill Thread #1 from your
        > Home Program. PauseThread(1);
        >
        > #2 Looks like Jogging Thread #1 may be disabled while the Homing Flag
        > is set? Maybe leave it set permanently.
        >
        > #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the
        > problem. The risk here is once you change what is flashed in KFLOP
        > there is no way to restore it if you don't know exactly what needs to
        > be put back. If you make a mistake you might end up dead in the
        > water. A spare KFLOP would allow you to experiment without altering
        > the original KFLOP.
        >
        > There is a way to experiment putting new programs into Threads #1 and
        > #6 without re-Flashing. You can halt all threads. Then
        > Compile/Download new programs to them. Then Execute #6. In this way
        > you could see if the changed programs cause things to now behave
        > properly. But the risk is that the new programs might cause
        > everything to work correctly but be missing something that the
        > original programs Flashed in KFLOP did. So then if flashed in by
        > themselves would not work correctly.
        >
        > HTH
        >
        > Regards
        >
        > TK
        >
        > On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >
        >> Hi Tom,
        >>
        >> Thread #1 seemed to be the culprit. When I push halt before I home
        >> then all homes perfectly.
        >>
        >> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >> the "Done" box have checks for the same numbers but they are shaded
        >> out. When I start the home program #2 starts homing first, the
        >> "done" stays shaded but unchecks and the Dest/Postion both increase
        >> first, then decreases to a small negative number and then drifts to
        >> zero and stops. This then happens the same way for #0, then#2,
        >> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and #6
        >> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >> Position stays at "1".
        >>
        >> Taking your clue of looking at which thread is green, I noticed that
        >> both 1 and 2 thread highlight when the homing is activated. But now
        >> that I've halted #1 only #2 is green and it turns off when the
        >> homing program stops. I also noticed that if I power off/on thread
        >> #1 turns green again when homing, but if I halt it first before
        >> homing it works as expected. If I halt it once, it seems to stay
        >> halted unless the cnc messes up and I have to power the KFlop off/on
        >> to fix the glitch. Then the #1 thread become active again.
        >>
        >> Since bit_log_sLimit.c also includes all of these:
        >>
        >> include "KMotionDef.h"
        >> #include "defines.h"
        >> #include "pthread.h"
        >> #include "util.h"
        >> #include "..\k2_settings.h" Do you think the problem lies in the .c
        >> program or one of the .h programs?
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> It looks like Axis #3 has an encoder and it is counting correctly as
        >> the Destination and Position nearly match.
        >>
        >> It would have been helpful if you described what happens on the Axis
        >> Screen throughout the Homing sequence.
        >>
        >> All I can think of is that some other program is running and after
        >> Homing is complete decides to move the A axis for some reason.
        >>
        >> From earlier posts I'm guessing
        >>
        >> Driver\bitJog_sLimit.c
        >> is flashed into Thread #1 and is running. Was that file originally
        >> loaded into the KMotion.exe Thread #1 editor? If you go to
        >> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >> indicating a program is running? If so try selecting Thread #1 and
        >> push Halt. Does the Green bar go away? Does Homing still work?
        >> Does A still Drift?
        >>
        >> Regards
        >> TK
        >>
        >> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> See attached for png files. If you need jpeg I'll resend.
        >>
        >> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >> it then drifted positive and kept going. I hit pause to stop it from
        >> turning.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> C Functions exit and return to where they were called either at the
        >> end of the function or when they are told to return.
        >>
        >> Strange there is drift positive as the Home program tells the motion
        >> to stop. Maybe the axis is configured as closed loop and is trying
        >> to correct an error?
        >>
        >> I'm assuming that the A Axis is axis #3
        >>
        >> As the Axis is drifting go to the KMotion.exe Axis screen and
        >> observe the Axis #3 Dest and Position and tell us what they are
        >> doing.
        >>
        >> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >> Upload to upload the current configuration to the Screen, then post
        >> a screen shot for us to look at.
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> Yes, it took me a bit to understand that it had to be before the
        >> function return. At first I thought it only had to be the last line
        >> before the bracket.
        >>
        >> So, to answer your question, Yes the A axis drifts positive after it
        >> backs up at the limit switch.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Monday, July 18, 2016 6:43:24 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> ok Great. I assume you understand now why putting it after the
        >> function return would never execute.
        >>
        >> So we now know for sure what code is actually being executed and
        >> that the function enters and exits for all 4 axes including A. Does
        >> the A Axis still home and then drift positive as you describe
        >> before?
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> I moved the printf("Exiting Home_Single now\n"); around just to see
        >> where it would print and found that if I put it just before the
        >> "return 1; then it will print printf("Exiting Home_Single now\n");
        >> as well as Entering.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: Robert Taormina
        >> SENT: Monday, July 18, 2016 9:55:19 AM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Good Morning Tom,
        >>
        >> Thanks for the bracketing help. I think I put the printf in the
        >> correct place now. The "entering home" printed 4 times but the
        >> "exit home" did not print. It printed every time it started to home
        >> an axis. I expected to see some sort of number after each print
        >> message because of the "\n" (just a guess) but this did not happen.
        >> It looked like this:
        >>
        >> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >> Entering Home_Single now
        >> Entering Home_Single now
        >> Entering Home_Single now
        >> Entering Home_Single now
        >>
        >> Here is where I placed the commands:
        >>
        >> #include "KMotionDef.h"
        >> #include "Driver\Defines.c
        >>
        >> int Home_Single(int axis, int sw int Multiplier)
        >> {
        >> printf("Entering Home_Single now\n");
        >> int index_last;
        >> int index_this;
        >> int home_vel = Multiplier * 18000;
        >> int backup_vel = Multiplier * -2000;
        >> double savepos;
        >>
        >> Jog(axis, home_vel);
        >>
        >> while (ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >>
        >> Jog(axis,0); // StopMotion
        >> while(!CheckDone(axis)) ;
        >> Jog(axis, backup_vel);
        >> while (!ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >> savepos = chan[axis].Position;
        >> Jog(axis,0); // StopMotion
        >> Move(axis,savepos);
        >>
        >> while (!CheckDone(axis)) ;
        >>
        >> Delay_sec(.3);
        >> Zero(axis);
        >> Delay_sec(.1);
        >>
        >> return 1;
        >> printf("Exiting Home_Single now\n");
        >> }
        >>
        >> int main()
        >> {
        >> SetBit(Homing);
        >> ClearBit(CHECK_SOFT_LIMT);
        >> Home_Single(Z, pZ_SW, 1);
        >> Home_Single(X, pX_SW, 1);
        >> Home_Single(Y, pY_SW, 1);
        >> Home_Single(A, pA_SW, 1);
        >> ClearBit(Homing);
        >> SetBit(CHECK_SOFT_LIMT);
        >> return 0;
        >> }
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Saturday, July 16, 2016 1:52:32 AM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> You didn't put the printf statements within the Home_Single function
        >> so they will never execute. I know that C code probably looks
        >> totally nonsensical to you now but after learning several simple
        >> concepts it will quickly become readable. Please read this recent
        >> post and see if you are then able to put the printfs inside the
        >> Home_Single function:
        >>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> I opened the notebook++ and opened the homing program that I am
        >> using under an existing home button. I cut and pasted the first
        >> printf line in line #3 and the second one in line # 56. I then saved
        >> it, restarted the cnc and homed the cnc. I look into the console to
        >> see if anything printed and saw nothing.
        >>
        >> Here is the program with printf added.
        >> #include "KMotionDef.h"
        >> #include "Driver\Defines.c
        >> printf("Entering Home_Single now\n");
        >> int Home_Single(int axis, int sw int Multiplier)
        >> {
        >> int index_last;
        >> int index_this;
        >> int home_vel = Multiplier * 18000;
        >> int backup_vel = Multiplier * -2000;
        >> double savepos;
        >>
        >> Jog(axis, home_vel);
        >>
        >> while (ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >>
        >> Jog(axis,0); // StopMotion
        >> while(!CheckDone(axis)) ;
        >> Jog(axis, backup_vel);
        >> while (!ReadBit(sw)) // wait for switch to change
        >> {
        >> Delay_sec(.001); // little delay for debounce
        >> if (CheckDone(axis))
        >> break;
        >> }
        >> savepos = chan[axis].Position;
        >> Jog(axis,0); // StopMotion
        >> Move(axis,savepos);
        >>
        >> while (!CheckDone(axis)) ;
        >>
        >> Delay_sec(.3);
        >> Zero(axis);
        >> Delay_sec(.1);
        >>
        >> return 1;
        >> }
        >>
        >> int main()
        >> {
        >> SetBit(Homing);
        >> ClearBit(CHECK_SOFT_LIMT);
        >> Home_Single(Z, pZ_SW, 1);
        >> Home_Single(X, pX_SW, 1);
        >> Home_Single(Y, pY_SW, 1);
        >> Home_Single(A, pA_SW, 1);
        >> ClearBit(Homing);
        >> SetBit(CHECK_SOFT_LIMT);
        >> return 0;
        >> }
        >> printf("Exiting Home_Single now\n");
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 15, 2016 4:00:06 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> No. If you put a printf into a program, assign that program to a
        >> button, and push the button something should print. Let's focus on
        >> getting that to work before doing anything else. Let's repeat that
        >> experiment. If it doesn't work explain in great detail what you are
        >> doing so we can try to figure out what is going wrong.
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >> Hi Tom,
        >>
        >> OK, so I've saved the variables.
        >>
        >> You had asked that I put the printf lines in the Homing program. I
        >> tried it with the program that I have listed under the buttons and
        >> nothing seemed to happen. But then you mentioned that I needed to
        >> flash it which got me thinking that their may be another Homing
        >> program in the Kflop. Which homing program, the one under the button
        >> or the one in Kflop thread should I have altered? I assume if it was
        >> the one under the button I would not have to flash it. If it's the
        >> program in the Kflop then I would have to flash it. The file in the
        >> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>
        >> Should I send you the files that I think are flashed in the KFlop
        >> threads?
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 15, 2016 3:04:15 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> The Send line isn't important. That is just the last Console Command
        >>
        >> someone issued to KFLOP.
        >>
        >> To put those back you could write a C Program to read that file and
        >> put
        >> those back. Or just manually set them with Console Commands (ie
        >> SetPersistDec). Let's not worry about that until if/when the issue
        >> comes up. The important thing is that the data is backed up.
        >>
        >> Those are User Variables. Unfortunately there isn't a means of
        >> reading
        >> programs out of KFLOP (KFLOP only contains the binary data). If you
        >> were to study the K2CNC programs you could see what all those
        >> variables
        >> were used for.
        >>
        >> Regards
        >> TK
        >>
        >> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>> Hi Tom,
        >>>
        >>> OK, see below for what was in the console. I will save that as a
        >> tx
        >>> file. In the "send" line it says Zero2. Is this important? In the
        >>> future, how would I put this back into the KFLOP? I was expecting
        >> to
        >>> see a list of programs that are currently in the KFLOP.
        >>>
        >>> Robert
        >>>
        >>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>> 0 = 12
        >>> 1 = 0
        >>> 2 = 0
        >>> 3 = 0
        >>> 4 = 0
        >>> 5 = 0
        >>> 6 = 0
        >>> 7 = 54321
        >>> 8 = 2
        >>> 9 = 204
        >>> 10 = 0
        >>> 11 = 7
        >>> 12 = 0
        >>> 13 = 7
        >>> 14 = 0
        >>> 15 = 0
        >>> 16 = 0
        >>> 17 = 0
        >>> 18 = 0
        >>> 19 = 0
        >>> 20 = 0
        >>> 21 = 0
        >>> 22 = 0
        >>> 23 = 0
        >>> 24 = 0
        >>> 25 = 0
        >>> 26 = 0
        >>> 27 = 0
        >>> 28 = 0
        >>> 29 = 0
        >>> 30 = 0
        >>> 31 = 1176256512
        >>> 32 = 0
        >>> 33 = 0
        >>> 34 = 0
        >>> 35 = 0
        >>> 36 = 0
        >>> 37 = 0
        >>> 38 = 0
        >>> 39 = 0
        >>> 40 = 20000
        >>> 41 = 30000
        >>> 42 = 50000
        >>> 43 = 0
        >>> 44 = 0
        >>> 45 = -1
        >>> 46 = -1
        >>> 47 = 0
        >>> 48 = 0
        >>> 49 = 0
        >>> 50 = 20000
        >>> 51 = 20000
        >>> 52 = 20000
        >>> 53 = 20000
        >>> 54 = 5000
        >>> 55 = 5000
        >>> 56 = 0
        >>> 57 = 0
        >>> 58 = 0
        >>> 59 = 0
        >>> 60 = 0
        >>> 61 = 0
        >>> 62 = 0
        >>> 63 = 0
        >>> 64 = 0
        >>> 65 = 0
        >>> 66 = 0
        >>> 67 = 0
        >>> 68 = 0
        >>> 69 = 0
        >>> 70 = 0
        >>> 71 = 0
        >>> 72 = 0
        >>> 73 = 0
        >>> 74 = 0
        >>> 75 = 0
        >>> 76 = 0
        >>> 77 = 0
        >>> 78 = 0
        >>> 79 = 0
        >>> 80 = 0
        >>> 81 = 0
        >>> 82 = 0
        >>> 83 = 0
        >>> 84 = 0
        >>> 85 = 0
        >>> 86 = 0
        >>> 87 = 0
        >>> 88 = 0
        >>> 89 = 0
        >>> 90 = 0
        >>> 91 = 0
        >>> 92 = 0
        >>> 93 = 0
        >>> 94 = 0
        >>> 95 = 0
        >>> 96 = 0
        >>> 97 = 0
        >>> 98 = 0
        >>> 99 = 0
        >>> 100 = 0
        >>> 101 = 0
        >>> 102 = 0
        >>> 103 = 0
        >>> 104 = 0
        >>> 105 = 0
        >>> 106 = 0
        >>> 107 = 0
        >>> 108 = 0
        >>> 109 = 0
        >>> 110 = 0
        >>> 111 = 0
        >>> 112 = 0
        >>> 113 = 0
        >>> 114 = 0
        >>> 115 = 0
        >>> 116 = 0
        >>> 117 = 0
        >>> 118 = 0
        >>> 119 = 0
        >>> 120 = 0
        >>> 121 = 1087950336
        >>> 122 = 0
        >>> 123 = 1087950336
        >>> 124 = 0
        >>> 125 = 1087950336
        >>> 126 = 0
        >>> 127 = 1086556160
        >>> 128 = 0
        >>> 129 = 1086556160
        >>> 130 = 0
        >>> 131 = 1086556160
        >>> 132 = 0
        >>> 133 = -1070071808
        >>> 134 = -1717986918
        >>> 135 = 1068079513
        >>> 136 = 0
        >>> 137 = -1069318144
        >>> 138 = -1717986918
        >>> 139 = 1069128089
        >>> 140 = 0
        >>> 141 = -1071906816
        >>> 142 = 0
        >>> 143 = 0
        >>> 144 = 0
        >>> 145 = -1053916032
        >>> 146 = 0
        >>> 147 = 1093567616
        >>> 148 = 0
        >>> 149 = -1053916032
        >>> 150 = 0
        >>> 151 = 1093567616
        >>> 152 = 0
        >>> 153 = -1053916032
        >>> 154 = 0
        >>> 155 = 1093567616
        >>> 156 = 0
        >>> 157 = 0
        >>> 158 = 0
        >>> 159 = 0
        >>> 160 = 0
        >>> 161 = 0
        >>> 162 = 0
        >>> 163 = 0
        >>> 164 = 0
        >>> 165 = 0
        >>> 166 = 0
        >>> 167 = 0
        >>> 168 = 0
        >>> 169 = 0
        >>> 170 = 0
        >>> 171 = 0
        >>> 172 = 0
        >>> 173 = 0
        >>> 174 = 0
        >>> 175 = 0
        >>> 176 = 0
        >>> 177 = 0
        >>> 178 = 0
        >>> 179 = 0
        >>> 180 = 0
        >>> 181 = 0
        >>> 182 = 0
        >>> 183 = 0
        >>> 184 = 0
        >>> 185 = 0
        >>> 186 = 0
        >>> 187 = 0
        >>> 188 = 0
        >>> 189 = 0
        >>> 190 = 0
        >>> 191 = 0
        >>> 192 = 0
        >>> 193 = 0
        >>> 194 = 0
        >>> 195 = 0
        >>> 196 = 0
        >>> 197 = 0
        >>> 198 = 0
        >>> 199 = 0
        >>>

        Group: DynoMotion Message: 13668 From: TKSOFT Date: 8/5/2016
        Subject: Re: z-touch glitch?
        Hi Robert,

        Yes we should print out all the Persist variables in a different format
        to they can be pasted into a C Program in order to set them in the new
        board.

        That one line was only an example of what the new format should be for
        all the lines. Replace the printf line that I provided in my last email
        for the prinf in the program. Then run the program again. The format
        of the printout should be different.

        HTH
        Regards
        TK


        On 2016-08-03 06:51, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > Just to recap, so this is in preparation to change the KFLOP. Right?
        > Can you give me a little more instruction?
        >
        > This is what I can see. If I put this program in thread #7 and run
        > it:
        >
        > #include "KMotionDef.h"
        >
        > main()
        > {
        > int i;
        > for (i=0;i<200;i++)
        > printf("%d = %d\n",i,persist.UserData[i]);
        >
        > }
        > Then I see a list of numbers in the Console. I can find and see (153
        > = -1053916032) in the listed numbers. I assume this is the number I
        > should be replacing. I not sure what to do next.
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        > SENT: Monday, August 1, 2016 5:30:41 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > I think we have everything - the persist variable settings and a guess
        >
        > at the flashed programs.
        >
        > The persist variable printout needs to be reformatted to easily set
        > all
        > the variables. The format needs to be changed from this format:
        >
        > 153 = -1053916032
        >
        > to this format:
        >
        > persist.UserData[153] = -1053916032;
        >
        > You should be able to do that with a text editor. Or we should have
        > printed them out that way with:
        >
        > printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);
        >
        > Can you do this?
        >
        > Regards
        > TK
        >
        > On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >> Hi Tom,
        >>
        >> I received the new KFLOP this week. Before I pull out the old one I
        >> was wondering if you could give me a list of what files/settings I
        >> will need to save before replacing it? I assume I will need to save
        >> and reload the settings for all the ac servo drives/motors.
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 22, 2016 4:01:53 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Tom,
        >>
        >> I was given the funds to purchase another KFLOP. Just wanted to let
        >> you know.
        >>
        >> I will put the paper work in to our office shortly.
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Thursday, July 21, 2016 4:05:49 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Tom,
        >>
        >> I like the idea of a second KFLOP so that we can experiment freely.
        > I
        >> will have to see if I have any budget for it. I assume from the
        >> website it's about $249? The cnc seems to work with thread #1
        > halted.
        >>
        >> I also like the idea of simple. Not truly understanding the pitfalls
        >> of the flashed programs maybe we should try putting in a kill thread
        >> in the homing program first. So, are you saying that the programs
        >> currently flashed may not be anywhere else on my computer? Last year
        >> we lost everything and re-flashed the KFLOP with the programs that I
        >> previously listed. So, maybe I lost what we needed then. But with
        > that
        >> said, maybe I did not do it correctly and maybe programs were still
        > on
        >> it? Just as a recap, I remember loading programs 1-6 into the
        > threads
        >> and then save, compile, download, run. Then went to config/flash and
        >> hit flash user memory. I think I then had to disconnect the computer
        >> form the KFLOP and cycle the power. I should say, I was not using
        > the
        >> cnc before this and so I could not attest to how it ran before.
        >>
        >> Tom, I still have some other issues with the machine. I know, one
        >> problem at a time, but just in case these problems are related I
        >> wanted to mention them.
        >>
        >> #1 The spindle speed is stuck on one speed. It bounces around from
        >> 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I
        > can
        >> change the spindle to manual and it works in manual so I don't think
        >> its the VFD)
        >>
        >> #2 The GUI Feed override and Speed override do not respond. Nether
        >> does entering a speed manual line at the bottom of the GUI.
        >>
        >> #3 I noticed that the K2_Driver.c in thread #6 lists Thread number
        > #4
        >> as having ToolChange.c not SetStepPulseLencth.c which is what looks
        > to
        >> be what I have in mine.
        >>
        >> #4 I also noticed that there is a homing program that is listed in
        >> thread #5 which is different than the homing program under the user
        >> buttons. Do you think one of these may be the wrong Homing program?
        > I
        >> have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that
        >> it should be homing.c. I'm wondering if last year I flashed the
        > wrong
        >> homing program into the KFLOP?
        >>
        >> The instructor last year using this said he used to be able to
        > change
        >> the speed as well as the feed rate override.
        >>
        >> Also, I'm using 432 version. Most likely not but, could any of these
        >> issue be related to this version and would it be best to flash the
        > new
        >> version?
        >>
        >> Thanks and sorry for all the questions, I just want to give you as
        >> much information as I can.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Thursday, July 21, 2016 2:00:20 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> Thanks the the good descriptions.
        >>
        >> I believe that makes sense. Here is how I'm thinking K2CNC arranged
        >> things and what is happening:
        >>
        >> #1 Thread #6 has the "Driver" program Flashed and configured to run
        > on
        >> startup
        >>
        >> #2 Thread #1 has the "Jog Limits" program Flashed
        >>
        >> #3 On Power UP the Driver program initializes things then tells
        > Thread
        >> #1 to execute
        >>
        >> #4 Your Home program (the one we've been adding printf's in) is
        >> configured in KMotionCNC to load/run in Thread #2
        >>
        >> #5 At the end of the Home Program after Homing is complete it sets
        >> some flags/variables. The running Thread #1 sees these flags and for
        >> whatever reason decides it should begin Jogging the A Axis.
        >>
        >> The "Jog Limits" program in Thread #1 seems very complex. I don't
        >> really have time to analyze it. It seems to even use SPI to
        >> communicate with something else to get I/O. Maybe Jog Joysticks?
        >> Buttons?
        >>
        >> Does everything seem to still function with Thread #1 Halted?
        >>
        >> Here are some ideas:
        >>
        >> #1 it would be easy to add a statement to Kill Thread #1 from your
        >> Home Program. PauseThread(1);
        >>
        >> #2 Looks like Jogging Thread #1 may be disabled while the Homing
        > Flag
        >> is set? Maybe leave it set permanently.
        >>
        >> #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the
        >> problem. The risk here is once you change what is flashed in KFLOP
        >> there is no way to restore it if you don't know exactly what needs
        > to
        >> be put back. If you make a mistake you might end up dead in the
        >> water. A spare KFLOP would allow you to experiment without altering
        >> the original KFLOP.
        >>
        >> There is a way to experiment putting new programs into Threads #1
        > and
        >> #6 without re-Flashing. You can halt all threads. Then
        >> Compile/Download new programs to them. Then Execute #6. In this way
        >> you could see if the changed programs cause things to now behave
        >> properly. But the risk is that the new programs might cause
        >> everything to work correctly but be missing something that the
        >> original programs Flashed in KFLOP did. So then if flashed in by
        >> themselves would not work correctly.
        >>
        >> HTH
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >>> Hi Tom,
        >>>
        >>> Thread #1 seemed to be the culprit. When I push halt before I home
        >>> then all homes perfectly.
        >>>
        >>> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >>> the "Done" box have checks for the same numbers but they are shaded
        >>> out. When I start the home program #2 starts homing first, the
        >>> "done" stays shaded but unchecks and the Dest/Postion both increase
        >>> first, then decreases to a small negative number and then drifts to
        >>> zero and stops. This then happens the same way for #0, then#2,
        >>> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and #6
        >>> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >>> Position stays at "1".
        >>>
        >>> Taking your clue of looking at which thread is green, I noticed
        > that
        >>> both 1 and 2 thread highlight when the homing is activated. But now
        >>> that I've halted #1 only #2 is green and it turns off when the
        >>> homing program stops. I also noticed that if I power off/on thread
        >>> #1 turns green again when homing, but if I halt it first before
        >>> homing it works as expected. If I halt it once, it seems to stay
        >>> halted unless the cnc messes up and I have to power the KFlop
        > off/on
        >>> to fix the glitch. Then the #1 thread become active again.
        >>>
        >>> Since bit_log_sLimit.c also includes all of these:
        >>>
        >>> include "KMotionDef.h"
        >>> #include "defines.h"
        >>> #include "pthread.h"
        >>> #include "util.h"
        >>> #include "..\k2_settings.h" Do you think the problem lies in the .c
        >>> program or one of the .h programs?
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> It looks like Axis #3 has an encoder and it is counting correctly
        > as
        >>> the Destination and Position nearly match.
        >>>
        >>> It would have been helpful if you described what happens on the
        > Axis
        >>> Screen throughout the Homing sequence.
        >>>
        >>> All I can think of is that some other program is running and after
        >>> Homing is complete decides to move the A axis for some reason.
        >>>
        >>> From earlier posts I'm guessing
        >>>
        >>> Driver\bitJog_sLimit.c
        >>> is flashed into Thread #1 and is running. Was that file originally
        >>> loaded into the KMotion.exe Thread #1 editor? If you go to
        >>> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >>> indicating a program is running? If so try selecting Thread #1 and
        >>> push Halt. Does the Green bar go away? Does Homing still work?
        >>> Does A still Drift?
        >>>
        >>> Regards
        >>> TK
        >>>
        >>> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> See attached for png files. If you need jpeg I'll resend.
        >>>
        >>> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >>> it then drifted positive and kept going. I hit pause to stop it
        > from
        >>> turning.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> C Functions exit and return to where they were called either at the
        >>> end of the function or when they are told to return.
        >>>
        >>> Strange there is drift positive as the Home program tells the
        > motion
        >>> to stop. Maybe the axis is configured as closed loop and is trying
        >>> to correct an error?
        >>>
        >>> I'm assuming that the A Axis is axis #3
        >>>
        >>> As the Axis is drifting go to the KMotion.exe Axis screen and
        >>> observe the Axis #3 Dest and Position and tell us what they are
        >>> doing.
        >>>
        >>> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >>> Upload to upload the current configuration to the Screen, then post
        >>> a screen shot for us to look at.
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> Yes, it took me a bit to understand that it had to be before the
        >>> function return. At first I thought it only had to be the last line
        >>> before the bracket.
        >>>
        >>> So, to answer your question, Yes the A axis drifts positive after
        > it
        >>> backs up at the limit switch.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Monday, July 18, 2016 6:43:24 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> ok Great. I assume you understand now why putting it after the
        >>> function return would never execute.
        >>>
        >>> So we now know for sure what code is actually being executed and
        >>> that the function enters and exits for all 4 axes including A. Does
        >>> the A Axis still home and then drift positive as you describe
        >>> before?
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> I moved the printf("Exiting Home_Single now\n"); around just to see
        >>> where it would print and found that if I put it just before the
        >>> "return 1; then it will print printf("Exiting Home_Single now\n");
        >>> as well as Entering.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: Robert Taormina
        >>> SENT: Monday, July 18, 2016 9:55:19 AM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Good Morning Tom,
        >>>
        >>> Thanks for the bracketing help. I think I put the printf in the
        >>> correct place now. The "entering home" printed 4 times but the
        >>> "exit home" did not print. It printed every time it started to home
        >>> an axis. I expected to see some sort of number after each print
        >>> message because of the "\n" (just a guess) but this did not happen.
        >>> It looked like this:
        >>>
        >>> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>>
        >>> Here is where I placed the commands:
        >>>
        >>> #include "KMotionDef.h"
        >>> #include "Driver\Defines.c
        >>>
        >>> int Home_Single(int axis, int sw int Multiplier)
        >>> {
        >>> printf("Entering Home_Single now\n");
        >>> int index_last;
        >>> int index_this;
        >>> int home_vel = Multiplier * 18000;
        >>> int backup_vel = Multiplier * -2000;
        >>> double savepos;
        >>>
        >>> Jog(axis, home_vel);
        >>>
        >>> while (ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>>
        >>> Jog(axis,0); // StopMotion
        >>> while(!CheckDone(axis)) ;
        >>> Jog(axis, backup_vel);
        >>> while (!ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>> savepos = chan[axis].Position;
        >>> Jog(axis,0); // StopMotion
        >>> Move(axis,savepos);
        >>>
        >>> while (!CheckDone(axis)) ;
        >>>
        >>> Delay_sec(.3);
        >>> Zero(axis);
        >>> Delay_sec(.1);
        >>>
        >>> return 1;
        >>> printf("Exiting Home_Single now\n");
        >>> }
        >>>
        >>> int main()
        >>> {
        >>> SetBit(Homing);
        >>> ClearBit(CHECK_SOFT_LIMT);
        >>> Home_Single(Z, pZ_SW, 1);
        >>> Home_Single(X, pX_SW, 1);
        >>> Home_Single(Y, pY_SW, 1);
        >>> Home_Single(A, pA_SW, 1);
        >>> ClearBit(Homing);
        >>> SetBit(CHECK_SOFT_LIMT);
        >>> return 0;
        >>> }
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Saturday, July 16, 2016 1:52:32 AM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> You didn't put the printf statements within the Home_Single
        > function
        >>> so they will never execute. I know that C code probably looks
        >>> totally nonsensical to you now but after learning several simple
        >>> concepts it will quickly become readable. Please read this recent
        >>> post and see if you are then able to put the printfs inside the
        >>> Home_Single function:
        >>>
        >>>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>>
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> I opened the notebook++ and opened the homing program that I am
        >>> using under an existing home button. I cut and pasted the first
        >>> printf line in line #3 and the second one in line # 56. I then
        > saved
        >>> it, restarted the cnc and homed the cnc. I look into the console to
        >>> see if anything printed and saw nothing.
        >>>
        >>> Here is the program with printf added.
        >>> #include "KMotionDef.h"
        >>> #include "Driver\Defines.c
        >>> printf("Entering Home_Single now\n");
        >>> int Home_Single(int axis, int sw int Multiplier)
        >>> {
        >>> int index_last;
        >>> int index_this;
        >>> int home_vel = Multiplier * 18000;
        >>> int backup_vel = Multiplier * -2000;
        >>> double savepos;
        >>>
        >>> Jog(axis, home_vel);
        >>>
        >>> while (ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>>
        >>> Jog(axis,0); // StopMotion
        >>> while(!CheckDone(axis)) ;
        >>> Jog(axis, backup_vel);
        >>> while (!ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>> savepos = chan[axis].Position;
        >>> Jog(axis,0); // StopMotion
        >>> Move(axis,savepos);
        >>>
        >>> while (!CheckDone(axis)) ;
        >>>
        >>> Delay_sec(.3);
        >>> Zero(axis);
        >>> Delay_sec(.1);
        >>>
        >>> return 1;
        >>> }
        >>>
        >>> int main()
        >>> {
        >>> SetBit(Homing);
        >>> ClearBit(CHECK_SOFT_LIMT);
        >>> Home_Single(Z, pZ_SW, 1);
        >>> Home_Single(X, pX_SW, 1);
        >>> Home_Single(Y, pY_SW, 1);
        >>> Home_Single(A, pA_SW, 1);
        >>> ClearBit(Homing);
        >>> SetBit(CHECK_SOFT_LIMT);
        >>> return 0;
        >>> }
        >>> printf("Exiting Home_Single now\n");
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 15, 2016 4:00:06 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> No. If you put a printf into a program, assign that program to a
        >>> button, and push the button something should print. Let's focus on
        >>> getting that to work before doing anything else. Let's repeat that
        >>> experiment. If it doesn't work explain in great detail what you are
        >>> doing so we can try to figure out what is going wrong.
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> OK, so I've saved the variables.
        >>>
        >>> You had asked that I put the printf lines in the Homing program. I
        >>> tried it with the program that I have listed under the buttons and
        >>> nothing seemed to happen. But then you mentioned that I needed to
        >>> flash it which got me thinking that their may be another Homing
        >>> program in the Kflop. Which homing program, the one under the
        > button
        >>> or the one in Kflop thread should I have altered? I assume if it
        > was
        >>> the one under the button I would not have to flash it. If it's the
        >>> program in the Kflop then I would have to flash it. The file in the
        >>> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>>
        >>> Should I send you the files that I think are flashed in the KFlop
        >>> threads?
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 15, 2016 3:04:15 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> The Send line isn't important. That is just the last Console
        > Command
        >>>
        >>> someone issued to KFLOP.
        >>>
        >>> To put those back you could write a C Program to read that file and
        >>> put
        >>> those back. Or just manually set them with Console Commands (ie
        >>> SetPersistDec). Let's not worry about that until if/when the issue
        >>> comes up. The important thing is that the data is backed up.
        >>>
        >>> Those are User Variables. Unfortunately there isn't a means of
        >>> reading
        >>> programs out of KFLOP (KFLOP only contains the binary data). If you
        >>> were to study the K2CNC programs you could see what all those
        >>> variables
        >>> were used for.
        >>>
        >>> Regards
        >>> TK
        >>>
        >>> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>> Hi Tom,
        >>>>
        >>>> OK, see below for what was in the console. I will save that as a
        >>> tx
        >>>> file. In the "send" line it says Zero2. Is this important? In the
        >>>> future, how would I put this back into the KFLOP? I was expecting
        >>> to
        >>>> see a list of programs that are currently in the KFLOP.
        >>>>
        >>>> Robert
        >>>>
        >>>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>>> 0 = 12
        >>>> 1 = 0
        >>>> 2 = 0
        >>>> 3 = 0
        >>>> 4 = 0
        >>>> 5 = 0
        >>>> 6 = 0
        >>>> 7 = 54321
        >>>> 8 = 2
        >>>> 9 = 204
        >>>> 10 = 0
        >>>> 11 = 7
        >>>> 12 = 0
        >>>> 13 = 7
        >>>> 14 = 0
        >>>> 15 = 0
        >>>> 16 = 0
        >>>> 17 = 0
        >>>> 18 = 0
        >>>> 19 = 0
        >>>> 20 = 0
        >>>> 21 = 0
        >>>> 22 = 0
        >>>> 23 = 0
        >>>> 24 = 0
        >>>> 25 = 0
        >>>> 26 = 0
        >>>> 27 = 0
        >>>> 28 = 0
        >>>> 29 = 0
        >>>> 30 = 0
        >>>> 31 = 1176256512
        >>>> 32 = 0
        >>>> 33 = 0
        >>>> 34 = 0
        >>>> 35 = 0
        >>>> 36 = 0
        >>>> 37 = 0
        >>>> 38 = 0
        >>>> 39 = 0
        >>>> 40 = 20000
        >>>> 41 = 30000
        >>>> 42 = 50000
        >>>> 43 = 0
        >>>> 44 = 0
        >>>> 45 = -1
        >>>> 46 = -1
        >>>> 47 = 0
        >>>> 48 = 0
        >>>> 49 = 0
        >>>> 50 = 20000
        >>>> 51 = 20000
        >>>> 52 = 20000
        >>>> 53 = 20000
        >>>> 54 = 5000
        >>>> 55 = 5000
        >>>> 56 = 0
        >>>> 57 = 0
        >>>> 58 = 0
        >>>> 59 = 0
        >>>> 60 = 0
        >>>> 61 = 0
        >>>> 62 = 0
        >>>> 63 = 0
        >>>> 64 = 0
        >>>> 65 = 0
        >>>> 66 = 0
        >>>> 67 = 0
        >>>> 68 = 0
        >>>> 69 = 0
        >>>> 70 = 0
        >>>> 71 = 0
        >>>> 72 = 0
        >>>> 73 = 0
        >>>> 74 = 0
        >>>> 75 = 0
        >>>> 76 = 0
        >>>> 77 = 0
        >>>> 78 = 0
        >>>> 79 = 0
        >>>> 80 = 0
        >>>> 81 = 0
        >>>> 82 = 0
        >>>> 83 = 0
        >>>> 84 = 0
        >>>> 85 = 0
        >>>> 86 = 0
        >>>> 87 = 0
        >>>> 88 = 0
        >>>> 89 = 0
        >>>> 90 = 0
        >>>> 91 = 0
        >>>> 92 = 0
        >>>> 93 = 0
        >>>> 94 = 0
        >>>> 95 = 0
        >>>> 96 = 0
        >>>> 97 = 0
        >>>> 98 = 0
        >>>> 99 = 0
        >>>> 100 = 0
        >>>> 101 = 0
        >>>> 102 = 0
        >>>> 103 = 0
        >>>> 104 = 0
        >>>> 105 = 0
        >>>> 106 = 0
        >>>> 107 = 0
        >>>> 108 = 0
        >>>> 109 = 0
        >>>> 110 = 0
        >>>> 111 = 0
        >>>> 112 = 0
        >>>> 113 = 0
        >>>> 114 = 0
        >>>> 115 = 0
        >>>> 116 = 0
        >>>> 117 = 0
        >>>> 118 = 0
        >>>> 119 = 0
        >>>> 120 = 0
        >>>> 121 = 1087950336
        >>>> 122 = 0
        >>>> 123 = 1087950336
        >>>> 124 = 0
        >>>> 125 = 1087950336
        >>>> 126 = 0
        >>>> 127 = 1086556160
        >>>> 128 = 0
        >>>> 129 = 1086556160
        >>>> 130 = 0
        >>>> 131 = 1086556160
        >>>> 132 = 0
        >>>> 133 = -1070071808
        >>>> 134 = -1717986918
        >>>> 135 = 1068079513
        >>>> 136 = 0
        >>>> 137 = -1069318144
        >>>> 138 = -1717986918
        >>>> 139 = 1069128089
        >>>> 140 = 0
        >>>> 141 = -1071906816
        >>>> 142 = 0
        >>>> 143 = 0
        >>>> 144 = 0
        >>>> 145 = -1053916032
        >>>> 146 = 0
        >>>> 147 = 1093567616
        >>>> 148 = 0
        >>>> 149 = -1053916032
        >>>> 150 = 0
        >>>> 151 = 1093567616
        >>>> 152 = 0
        >>>> 153 = -1053916032
        >>>> 154 = 0
        >>>> 155 = 1093567616
        >>>> 156 = 0
        >>>> 157 = 0
        >>>> 158 = 0
        >>>> 159 = 0
        >>>> 160 = 0
        >>>> 161 = 0
        >>>> 162 = 0
        >>>> 163 = 0
        >>>> 164 = 0
        >>>> 165 = 0
        >>>> 166 = 0
        >>>> 167 = 0
        >>>> 168 = 0
        >>>> 169 = 0
        >>>> 170 = 0
        >>>> 171 = 0
        >>>> 172 = 0
        >>>> 173 = 0
        >>>> 174 = 0
        >>>> 175 = 0
        >>>> 176 = 0
        >>>> 177 = 0
        >>>> 178 = 0
        >>>> 179 = 0
        >>>> 180 = 0
        >>>> 181 = 0
        >>>> 182 = 0
        >>>> 183 = 0
        >>>> 184 = 0
        >>>> 185 = 0
        >>>> 186 = 0
        >>>> 187 = 0
        >>>> 188 = 0
        >>>> 189 = 0
        >>>> 190 = 0
        >>>> 191 = 0
        >>>> 192 = 0
        >>>> 193 = 0
        >>>> 194 = 0
        >>>> 195 = 0
        >>>> 196 = 0
        >>>> 197 = 0
        >>>> 198 = 0
        >>>> 199 = 0
        >>>>
        >
        Group: DynoMotion Message: 13693 From: Robert Taormina Date: 8/10/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        Could you give me some additional instruction?  Let me explain what I tried.

        I cut and pasted printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]); and replaced printf("%d = %d\n",i,persist.UserData[i]); into the simple program and put it in Thread #7 and hit RUN I get the same display in the Console screen. However, if I hit the "Save, Compile, Download, Run" then I get a "Compile error" at the new line.


        Any ideas?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, August 3, 2016 12:33:42 PM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Yes we should print out all the Persist variables in a different format
        to they can be pasted into a C Program in order to set them in the new
        board.

        That one line was only an example of what the new format should be for
        all the lines. Replace the printf line that I provided in my last email
        for the prinf in the program. Then run the program again. The format
        of the printout should be different.

        HTH
        Regards
        TK

        On 2016-08-03 06:51, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:

        > Hi Tom,
        >
        > Just to recap, so this is in preparation to change the KFLOP. Right?
        > Can you give me a little more instruction?
        >
        > This is what I can see. If I put this program in thread #7 and run
        > it:
        >
        > #include "KMotionDef.h"
        >
        > main()
        > {
        > int i;
        > for (i=0;i<200;i++)
        > printf("%d = %d\n",i,persist.UserData[i]);
        >
        > }
        > Then I see a list of numbers in the Console. I can find and see (153
        > = -1053916032) in the listed numbers. I assume this is the number I
        > should be replacing. I not sure what to do next.
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        > SENT: Monday, August 1, 2016 5:30:41 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > I think we have everything - the persist variable settings and a guess
        >
        > at the flashed programs.
        >
        > The persist variable printout needs to be reformatted to easily set
        > all
        > the variables. The format needs to be changed from this format:
        >
        > 153 = -1053916032
        >
        > to this format:
        >
        > persist.UserData[153] = -1053916032;
        >
        > You should be able to do that with a text editor. Or we should have
        > printed them out that way with:
        >
        > printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);
        >
        > Can you do this?
        >
        > Regards
        > TK
        >
        > On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >> Hi Tom,
        >>
        >> I received the new KFLOP this week. Before I pull out the old one I
        >> was wondering if you could give me a list of what files/settings I
        >> will need to save before replacing it? I assume I will need to save
        >> and reload the settings for all the ac servo drives/motors.
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Friday, July 22, 2016 4:01:53 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Tom,
        >>
        >> I was given the funds to purchase another KFLOP. Just wanted to let
        >> you know.
        >>
        >> I will put the paper work in to our office shortly.
        >>
        >> Thanks,
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Thursday, July 21, 2016 4:05:49 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Tom,
        >>
        >> I like the idea of a second KFLOP so that we can experiment freely.
        > I
        >> will have to see if I have any budget for it. I assume from the
        >> website it's about $249? The cnc seems to work with thread #1
        > halted.
        >>
        >> I also like the idea of simple. Not truly understanding the pitfalls
        >> of the flashed programs maybe we should try putting in a kill thread
        >> in the homing program first. So, are you saying that the programs
        >> currently flashed may not be anywhere else on my computer? Last year
        >> we lost everything and re-flashed the KFLOP with the programs that I
        >> previously listed. So, maybe I lost what we needed then. But with
        > that
        >> said, maybe I did not do it correctly and maybe programs were still
        > on
        >> it? Just as a recap, I remember loading programs 1-6 into the
        > threads
        >> and then save, compile, download, run. Then went to config/flash and
        >> hit flash user memory. I think I then had to disconnect the computer
        >> form the KFLOP and cycle the power. I should say, I was not using
        > the
        >> cnc before this and so I could not attest to how it ran before.
        >>
        >> Tom, I still have some other issues with the machine. I know, one
        >> problem at a time, but just in case these problems are related I
        >> wanted to mention them.
        >>
        >> #1 The spindle speed is stuck on one speed. It bounces around from
        >> 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I
        > can
        >> change the spindle to manual and it works in manual so I don't think
        >> its the VFD)
        >>
        >> #2 The GUI Feed override and Speed override do not respond. Nether
        >> does entering a speed manual line at the bottom of the GUI.
        >>
        >> #3 I noticed that the K2_Driver.c in thread #6 lists Thread number
        > #4
        >> as having ToolChange.c not SetStepPulseLencth.c which is what looks
        > to
        >> be what I have in mine.
        >>
        >> #4 I also noticed that there is a homing program that is listed in
        >> thread #5 which is different than the homing program under the user
        >> buttons. Do you think one of these may be the wrong Homing program?
        > I
        >> have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states that
        >> it should be homing.c. I'm wondering if last year I flashed the
        > wrong
        >> homing program into the KFLOP?
        >>
        >> The instructor last year using this said he used to be able to
        > change
        >> the speed as well as the feed rate override.
        >>
        >> Also, I'm using 432 version. Most likely not but, could any of these
        >> issue be related to this version and would it be best to flash the
        > new
        >> version?
        >>
        >> Thanks and sorry for all the questions, I just want to give you as
        >> much information as I can.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of Tom Kerekes tk@... [DynoMotion]
        >> <DynoMotion@yahoogroups.com>
        >> SENT: Thursday, July 21, 2016 2:00:20 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> Thanks the the good descriptions.
        >>
        >> I believe that makes sense. Here is how I'm thinking K2CNC arranged
        >> things and what is happening:
        >>
        >> #1 Thread #6 has the "Driver" program Flashed and configured to run
        > on
        >> startup
        >>
        >> #2 Thread #1 has the "Jog Limits" program Flashed
        >>
        >> #3 On Power UP the Driver program initializes things then tells
        > Thread
        >> #1 to execute
        >>
        >> #4 Your Home program (the one we've been adding printf's in) is
        >> configured in KMotionCNC to load/run in Thread #2
        >>
        >> #5 At the end of the Home Program after Homing is complete it sets
        >> some flags/variables. The running Thread #1 sees these flags and for
        >> whatever reason decides it should begin Jogging the A Axis.
        >>
        >> The "Jog Limits" program in Thread #1 seems very complex. I don't
        >> really have time to analyze it. It seems to even use SPI to
        >> communicate with something else to get I/O. Maybe Jog Joysticks?
        >> Buttons?
        >>
        >> Does everything seem to still function with Thread #1 Halted?
        >>
        >> Here are some ideas:
        >>
        >> #1 it would be easy to add a statement to Kill Thread #1 from your
        >> Home Program. PauseThread(1);
        >>
        >> #2 Looks like Jogging Thread #1 may be disabled while the Homing
        > Flag
        >> is set? Maybe leave it set permanently.
        >>
        >> #3 Delete or modify Programs in Thread #6 and Thread #1 to solve the
        >> problem. The risk here is once you change what is flashed in KFLOP
        >> there is no way to restore it if you don't know exactly what needs
        > to
        >> be put back. If you make a mistake you might end up dead in the
        >> water. A spare KFLOP would allow you to experiment without altering
        >> the original KFLOP.
        >>
        >> There is a way to experiment putting new programs into Threads #1
        > and
        >> #6 without re-Flashing. You can halt all threads. Then
        >> Compile/Download new programs to them. Then Execute #6. In this way
        >> you could see if the changed programs cause things to now behave
        >> properly. But the risk is that the new programs might cause
        >> everything to work correctly but be missing something that the
        >> original programs Flashed in KFLOP did. So then if flashed in by
        >> themselves would not work correctly.
        >>
        >> HTH
        >>
        >> Regards
        >>
        >> TK
        >>
        >> On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>
        >>> Hi Tom,
        >>>
        >>> Thread #1 seemed to be the culprit. When I push halt before I home
        >>> then all homes perfectly.
        >>>
        >>> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >>> the "Done" box have checks for the same numbers but they are shaded
        >>> out. When I start the home program #2 starts homing first, the
        >>> "done" stays shaded but unchecks and the Dest/Postion both increase
        >>> first, then decreases to a small negative number and then drifts to
        >>> zero and stops. This then happens the same way for #0, then#2,
        >>> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and #6
        >>> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >>> Position stays at "1".
        >>>
        >>> Taking your clue of looking at which thread is green, I noticed
        > that
        >>> both 1 and 2 thread highlight when the homing is activated. But now
        >>> that I've halted #1 only #2 is green and it turns off when the
        >>> homing program stops. I also noticed that if I power off/on thread
        >>> #1 turns green again when homing, but if I halt it first before
        >>> homing it works as expected. If I halt it once, it seems to stay
        >>> halted unless the cnc messes up and I have to power the KFlop
        > off/on
        >>> to fix the glitch. Then the #1 thread become active again.
        >>>
        >>> Since bit_log_sLimit.c also includes all of these:
        >>>
        >>> include "KMotionDef.h"
        >>> #include "defines.h"
        >>> #include "pthread.h"
        >>> #include "util.h"
        >>> #include "..\k2_settings.h" Do you think the problem lies in the .c
        >>> program or one of the .h programs?
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> It looks like Axis #3 has an encoder and it is counting correctly
        > as
        >>> the Destination and Position nearly match.
        >>>
        >>> It would have been helpful if you described what happens on the
        > Axis
        >>> Screen throughout the Homing sequence.
        >>>
        >>> All I can think of is that some other program is running and after
        >>> Homing is complete decides to move the A axis for some reason.
        >>>
        >>> From earlier posts I'm guessing
        >>>
        >>> Driver\bitJog_sLimit.c
        >>> is flashed into Thread #1 and is running. Was that file originally
        >>> loaded into the KMotion.exe Thread #1 editor? If you go to
        >>> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >>> indicating a program is running? If so try selecting Thread #1 and
        >>> push Halt. Does the Green bar go away? Does Homing still work?
        >>> Does A still Drift?
        >>>
        >>> Regards
        >>> TK
        >>>
        >>> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> See attached for png files. If you need jpeg I'll resend.
        >>>
        >>> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >>> it then drifted positive and kept going. I hit pause to stop it
        > from
        >>> turning.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> C Functions exit and return to where they were called either at the
        >>> end of the function or when they are told to return.
        >>>
        >>> Strange there is drift positive as the Home program tells the
        > motion
        >>> to stop. Maybe the axis is configured as closed loop and is trying
        >>> to correct an error?
        >>>
        >>> I'm assuming that the A Axis is axis #3
        >>>
        >>> As the Axis is drifting go to the KMotion.exe Axis screen and
        >>> observe the Axis #3 Dest and Position and tell us what they are
        >>> doing.
        >>>
        >>> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >>> Upload to upload the current configuration to the Screen, then post
        >>> a screen shot for us to look at.
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> Yes, it took me a bit to understand that it had to be before the
        >>> function return. At first I thought it only had to be the last line
        >>> before the bracket.
        >>>
        >>> So, to answer your question, Yes the A axis drifts positive after
        > it
        >>> backs up at the limit switch.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Monday, July 18, 2016 6:43:24 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> ok Great. I assume you understand now why putting it after the
        >>> function return would never execute.
        >>>
        >>> So we now know for sure what code is actually being executed and
        >>> that the function enters and exits for all 4 axes including A. Does
        >>> the A Axis still home and then drift positive as you describe
        >>> before?
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> I moved the printf("Exiting Home_Single now\n"); around just to see
        >>> where it would print and found that if I put it just before the
        >>> "return 1; then it will print printf("Exiting Home_Single now\n");
        >>> as well as Entering.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: Robert Taormina
        >>> SENT: Monday, July 18, 2016 9:55:19 AM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Good Morning Tom,
        >>>
        >>> Thanks for the bracketing help. I think I put the printf in the
        >>> correct place now. The "entering home" printed 4 times but the
        >>> "exit home" did not print. It printed every time it started to home
        >>> an axis. I expected to see some sort of number after each print
        >>> message because of the "\n" (just a guess) but this did not happen.
        >>> It looked like this:
        >>>
        >>> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>> Entering Home_Single now
        >>>
        >>> Here is where I placed the commands:
        >>>
        >>> #include "KMotionDef.h"
        >>> #include "Driver\Defines.c
        >>>
        >>> int Home_Single(int axis, int sw int Multiplier)
        >>> {
        >>> printf("Entering Home_Single now\n");
        >>> int index_last;
        >>> int index_this;
        >>> int home_vel = Multiplier * 18000;
        >>> int backup_vel = Multiplier * -2000;
        >>> double savepos;
        >>>
        >>> Jog(axis, home_vel);
        >>>
        >>> while (ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>>
        >>> Jog(axis,0); // StopMotion
        >>> while(!CheckDone(axis)) ;
        >>> Jog(axis, backup_vel);
        >>> while (!ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>> savepos = chan[axis].Position;
        >>> Jog(axis,0); // StopMotion
        >>> Move(axis,savepos);
        >>>
        >>> while (!CheckDone(axis)) ;
        >>>
        >>> Delay_sec(.3);
        >>> Zero(axis);
        >>> Delay_sec(.1);
        >>>
        >>> return 1;
        >>> printf("Exiting Home_Single now\n");
        >>> }
        >>>
        >>> int main()
        >>> {
        >>> SetBit(Homing);
        >>> ClearBit(CHECK_SOFT_LIMT);
        >>> Home_Single(Z, pZ_SW, 1);
        >>> Home_Single(X, pX_SW, 1);
        >>> Home_Single(Y, pY_SW, 1);
        >>> Home_Single(A, pA_SW, 1);
        >>> ClearBit(Homing);
        >>> SetBit(CHECK_SOFT_LIMT);
        >>> return 0;
        >>> }
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Saturday, July 16, 2016 1:52:32 AM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> You didn't put the printf statements within the Home_Single
        > function
        >>> so they will never execute. I know that C code probably looks
        >>> totally nonsensical to you now but after learning several simple
        >>> concepts it will quickly become readable. Please read this recent
        >>> post and see if you are then able to put the printfs inside the
        >>> Home_Single function:
        >>>
        >>>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>>
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> I opened the notebook++ and opened the homing program that I am
        >>> using under an existing home button. I cut and pasted the first
        >>> printf line in line #3 and the second one in line # 56. I then
        > saved
        >>> it, restarted the cnc and homed the cnc. I look into the console to
        >>> see if anything printed and saw nothing.
        >>>
        >>> Here is the program with printf added.
        >>> #include "KMotionDef.h"
        >>> #include "Driver\Defines.c
        >>> printf("Entering Home_Single now\n");
        >>> int Home_Single(int axis, int sw int Multiplier)
        >>> {
        >>> int index_last;
        >>> int index_this;
        >>> int home_vel = Multiplier * 18000;
        >>> int backup_vel = Multiplier * -2000;
        >>> double savepos;
        >>>
        >>> Jog(axis, home_vel);
        >>>
        >>> while (ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>>
        >>> Jog(axis,0); // StopMotion
        >>> while(!CheckDone(axis)) ;
        >>> Jog(axis, backup_vel);
        >>> while (!ReadBit(sw)) // wait for switch to change
        >>> {
        >>> Delay_sec(.001); // little delay for debounce
        >>> if (CheckDone(axis))
        >>> break;
        >>> }
        >>> savepos = chan[axis].Position;
        >>> Jog(axis,0); // StopMotion
        >>> Move(axis,savepos);
        >>>
        >>> while (!CheckDone(axis)) ;
        >>>
        >>> Delay_sec(.3);
        >>> Zero(axis);
        >>> Delay_sec(.1);
        >>>
        >>> return 1;
        >>> }
        >>>
        >>> int main()
        >>> {
        >>> SetBit(Homing);
        >>> ClearBit(CHECK_SOFT_LIMT);
        >>> Home_Single(Z, pZ_SW, 1);
        >>> Home_Single(X, pX_SW, 1);
        >>> Home_Single(Y, pY_SW, 1);
        >>> Home_Single(A, pA_SW, 1);
        >>> ClearBit(Homing);
        >>> SetBit(CHECK_SOFT_LIMT);
        >>> return 0;
        >>> }
        >>> printf("Exiting Home_Single now\n");
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 15, 2016 4:00:06 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> No. If you put a printf into a program, assign that program to a
        >>> button, and push the button something should print. Let's focus on
        >>> getting that to work before doing anything else. Let's repeat that
        >>> experiment. If it doesn't work explain in great detail what you are
        >>> doing so we can try to figure out what is going wrong.
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>> Hi Tom,
        >>>
        >>> OK, so I've saved the variables.
        >>>
        >>> You had asked that I put the printf lines in the Homing program. I
        >>> tried it with the program that I have listed under the buttons and
        >>> nothing seemed to happen. But then you mentioned that I needed to
        >>> flash it which got me thinking that their may be another Homing
        >>> program in the Kflop. Which homing program, the one under the
        > button
        >>> or the one in Kflop thread should I have altered? I assume if it
        > was
        >>> the one under the button I would not have to flash it. If it's the
        >>> program in the Kflop then I would have to flash it. The file in the
        >>> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>>
        >>> Should I send you the files that I think are flashed in the KFlop
        >>> threads?
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 15, 2016 3:04:15 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> The Send line isn't important. That is just the last Console
        > Command
        >>>
        >>> someone issued to KFLOP.
        >>>
        >>> To put those back you could write a C Program to read that file and
        >>> put
        >>> those back. Or just manually set them with Console Commands (ie
        >>> SetPersistDec). Let's not worry about that until if/when the issue
        >>> comes up. The important thing is that the data is backed up.
        >>>
        >>> Those are User Variables. Unfortunately there isn't a means of
        >>> reading
        >>> programs out of KFLOP (KFLOP only contains the binary data). If you
        >>> were to study the K2CNC programs you could see what all those
        >>> variables
        >>> were used for.
        >>>
        >>> Regards
        >>> TK
        >>>
        >>> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>> Hi Tom,
        >>>>
        >>>> OK, see below for what was in the console. I will save that as a
        >>> tx
        >>>> file. In the "send" line it says Zero2. Is this important? In the
        >>>> future, how would I put this back into the KFLOP? I was expecting
        >>> to
        >>>> see a list of programs that are currently in the KFLOP.
        >>>>
        >>>> Robert
        >>>>
        >>>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>>> 0 = 12
        >>>> 1 = 0
        >>>> 2 = 0
        >>>> 3 = 0
        >>>> 4 = 0
        >>>> 5 = 0
        >>>> 6 = 0
        >>>> 7 = 54321
        >>>> 8 = 2
        >>>> 9 = 204
        >>>> 10 = 0
        >>>> 11 = 7
        >>>> 12 = 0
        >>>> 13 = 7
        >>>> 14 = 0
        >>>> 15 = 0
        >>>> 16 = 0
        >>>> 17 = 0
        >>>> 18 = 0
        >>>> 19 = 0
        >>>> 20 = 0
        >>>> 21 = 0
        >>>> 22 = 0
        >>>> 23 = 0
        >>>> 24 = 0
        >>>> 25 = 0
        >>>> 26 = 0
        >>>> 27 = 0
        >>>> 28 = 0
        >>>> 29 = 0
        >>>> 30 = 0
        >>>> 31 = 1176256512
        >>>> 32 = 0
        >>>> 33 = 0
        >>>> 34 = 0
        >>>> 35 = 0
        >>>> 36 = 0
        >>>> 37 = 0
        >>>> 38 = 0
        >>>> 39 = 0
        >>>> 40 = 20000
        >>>> 41 = 30000
        >>>> 42 = 50000
        >>>> 43 = 0
        >>>> 44 = 0
        >>>> 45 = -1
        >>>> 46 = -1
        >>>> 47 = 0
        >>>> 48 = 0
        >>>> 49 = 0
        >>>> 50 = 20000
        >>>> 51 = 20000
        >>>> 52 = 20000
        >>>> 53 = 20000
        >>>> 54 = 5000
        >>>> 55 = 5000
        >>>> 56 = 0
        >>>> 57 = 0
        >>>> 58 = 0
        >>>> 59 = 0
        >>>> 60 = 0
        >>>> 61 = 0
        >>>> 62 = 0
        >>>> 63 = 0
        >>>> 64 = 0
        >>>> 65 = 0
        >>>> 66 = 0
        >>>> 67 = 0
        >>>> 68 = 0
        >>>> 69 = 0
        >>>> 70 = 0
        >>>> 71 = 0
        >>>> 72 = 0
        >>>> 73 = 0
        >>>> 74 = 0
        >>>> 75 = 0
        >>>> 76 = 0
        >>>> 77 = 0
        >>>> 78 = 0
        >>>> 79 = 0
        >>>> 80 = 0
        >>>> 81 = 0
        >>>> 82 = 0
        >>>> 83 = 0
        >>>> 84 = 0
        >>>> 85 = 0
        >>>> 86 = 0
        >>>> 87 = 0
        >>>> 88 = 0
        >>>> 89 = 0
        >>>> 90 = 0
        >>>> 91 = 0
        >>>> 92 = 0
        >>>> 93 = 0
        >>>> 94 = 0
        >>>> 95 = 0
        >>>> 96 = 0
        >>>> 97 = 0
        >>>> 98 = 0
        >>>> 99 = 0
        >>>> 100 = 0
        >>>> 101 = 0
        >>>> 102 = 0
        >>>> 103 = 0
        >>>> 104 = 0
        >>>> 105 = 0
        >>>> 106 = 0
        >>>> 107 = 0
        >>>> 108 = 0
        >>>> 109 = 0
        >>>> 110 = 0
        >>>> 111 = 0
        >>>> 112 = 0
        >>>> 113 = 0
        >>>> 114 = 0
        >>>> 115 = 0
        >>>> 116 = 0
        >>>> 117 = 0
        >>>> 118 = 0
        >>>> 119 = 0
        >>>> 120 = 0
        >>>> 121 = 1087950336
        >>>> 122 = 0
        >>>> 123 = 1087950336
        >>>> 124 = 0
        >>>> 125 = 1087950336
        >>>> 126 = 0
        >>>> 127 = 1086556160
        >>>> 128 = 0
        >>>> 129 = 1086556160
        >>>> 130 = 0
        >>>> 131 = 1086556160
        >>>> 132 = 0
        >>>> 133 = -1070071808
        >>>> 134 = -1717986918
        >>>> 135 = 1068079513
        >>>> 136 = 0
        >>>> 137 = -1069318144
        >>>> 138 = -1717986918
        >>>> 139 = 1069128089
        >>>> 140 = 0
        >>>> 141 = -1071906816
        >>>> 142 = 0
        >>>> 143 = 0
        >>>> 144 = 0
        >>>> 145 = -1053916032
        >>>> 146 = 0
        >>>> 147 = 1093567616
        >>>> 148 = 0
        >>>> 149 = -1053916032
        >>>> 150 = 0
        >>>> 151 = 1093567616
        >>>> 152 = 0
        >>>> 153 = -1053916032
        >>>> 154 = 0
        >>>> 155 = 1093567616
        >>>> 156 = 0
        >>>> 157 = 0
        >>>> 158 = 0
        >>>> 159 = 0
        >>>> 160 = 0
        >>>> 161 = 0
        >>>> 162 = 0
        >>>> 163 = 0
        >>>> 164 = 0
        >>>> 165 = 0
        >>>> 166 = 0
        >>>> 167 = 0
        >>>> 168 = 0
        >>>> 169 = 0
        >>>> 170 = 0
        >>>> 171 = 0
        >>>> 172 = 0
        >>>> 173 = 0
        >>>> 174 = 0
        >>>> 175 = 0
        >>>> 176 = 0
        >>>> 177 = 0
        >>>> 178 = 0
        >>>> 179 = 0
        >>>> 180 = 0
        >>>> 181 = 0
        >>>> 182 = 0
        >>>> 183 = 0
        >>>> 184 = 0
        >>>> 185 = 0
        >>>> 186 = 0
        >>>> 187 = 0
        >>>> 188 = 0
        >>>> 189 = 0
        >>>> 190 = 0
        >>>> 191 = 0
        >>>> 192 = 0
        >>>> 193 = 0
        >>>> 194 = 0
        >>>> 195 = 0
        >>>> 196 = 0
        >>>> 197 = 0
        >>>> 198 = 0
        >>>> 199 = 0
        >>>>
        >

        Group: DynoMotion Message: 13694 From: TKSOFT Date: 8/10/2016
        Subject: Re: z-touch glitch?
        Hi Robert,

        Sorry my mistake. Between persist and UserData there should be a period
        '.' not a comma ','

        Yes you must "Save, Compile, Download, Run" whenever you change a
        program.

        Regards
        TK




        On 2016-08-10 08:31, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > Could you give me some additional instruction? Let me explain what I
        > tried.
        >
        > I cut and pasted printf("persist.UserData[%d] =
        > %d;\n",i,persist,UserData[i]); and replaced printf("%d =
        > %d\n",i,persist.UserData[i]); into the simple program and put it in
        > Thread #7 and hit RUN I get the same display in the Console screen.
        > However, if I hit the "Save, Compile, Download, Run" then I get a
        > "Compile error" at the new line.
        >
        > Any ideas?
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        > SENT: Wednesday, August 3, 2016 12:33:42 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > Yes we should print out all the Persist variables in a different
        > format
        > to they can be pasted into a C Program in order to set them in the new
        >
        > board.
        >
        > That one line was only an example of what the new format should be for
        >
        > all the lines. Replace the printf line that I provided in my last
        > email
        > for the prinf in the program. Then run the program again. The format
        > of the printout should be different.
        >
        > HTH
        > Regards
        > TK
        >
        > On 2016-08-03 06:51, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >> Hi Tom,
        >>
        >> Just to recap, so this is in preparation to change the KFLOP. Right?
        >> Can you give me a little more instruction?
        >>
        >> This is what I can see. If I put this program in thread #7 and run
        >> it:
        >>
        >> #include "KMotionDef.h"
        >>
        >> main()
        >> {
        >> int i;
        >> for (i=0;i<200;i++)
        >> printf("%d = %d\n",i,persist.UserData[i]);
        >>
        >> }
        >> Then I see a list of numbers in the Console. I can find and see (153
        >> = -1053916032) in the listed numbers. I assume this is the number I
        >> should be replacing. I not sure what to do next.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of tk@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        >> SENT: Monday, August 1, 2016 5:30:41 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> I think we have everything - the persist variable settings and a
        > guess
        >>
        >> at the flashed programs.
        >>
        >> The persist variable printout needs to be reformatted to easily set
        >> all
        >> the variables. The format needs to be changed from this format:
        >>
        >> 153 = -1053916032
        >>
        >> to this format:
        >>
        >> persist.UserData[153] = -1053916032;
        >>
        >> You should be able to do that with a text editor. Or we should have
        >> printed them out that way with:
        >>
        >> printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);
        >>
        >> Can you do this?
        >>
        >> Regards
        >> TK
        >>
        >> On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>> Hi Tom,
        >>>
        >>> I received the new KFLOP this week. Before I pull out the old one I
        >>> was wondering if you could give me a list of what files/settings I
        >>> will need to save before replacing it? I assume I will need to save
        >>> and reload the settings for all the ac servo drives/motors.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 22, 2016 4:01:53 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I was given the funds to purchase another KFLOP. Just wanted to let
        >>> you know.
        >>>
        >>> I will put the paper work in to our office shortly.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 4:05:49 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I like the idea of a second KFLOP so that we can experiment freely.
        >> I
        >>> will have to see if I have any budget for it. I assume from the
        >>> website it's about $249? The cnc seems to work with thread #1
        >> halted.
        >>>
        >>> I also like the idea of simple. Not truly understanding the
        > pitfalls
        >>> of the flashed programs maybe we should try putting in a kill
        > thread
        >>> in the homing program first. So, are you saying that the programs
        >>> currently flashed may not be anywhere else on my computer? Last
        > year
        >>> we lost everything and re-flashed the KFLOP with the programs that
        > I
        >>> previously listed. So, maybe I lost what we needed then. But with
        >> that
        >>> said, maybe I did not do it correctly and maybe programs were still
        >> on
        >>> it? Just as a recap, I remember loading programs 1-6 into the
        >> threads
        >>> and then save, compile, download, run. Then went to config/flash
        > and
        >>> hit flash user memory. I think I then had to disconnect the
        > computer
        >>> form the KFLOP and cycle the power. I should say, I was not using
        >> the
        >>> cnc before this and so I could not attest to how it ran before.
        >>>
        >>> Tom, I still have some other issues with the machine. I know, one
        >>> problem at a time, but just in case these problems are related I
        >>> wanted to mention them.
        >>>
        >>> #1 The spindle speed is stuck on one speed. It bounces around from
        >>> 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I
        >> can
        >>> change the spindle to manual and it works in manual so I don't
        > think
        >>> its the VFD)
        >>>
        >>> #2 The GUI Feed override and Speed override do not respond. Nether
        >>> does entering a speed manual line at the bottom of the GUI.
        >>>
        >>> #3 I noticed that the K2_Driver.c in thread #6 lists Thread number
        >> #4
        >>> as having ToolChange.c not SetStepPulseLencth.c which is what looks
        >> to
        >>> be what I have in mine.
        >>>
        >>> #4 I also noticed that there is a homing program that is listed in
        >>> thread #5 which is different than the homing program under the user
        >>> buttons. Do you think one of these may be the wrong Homing program?
        >> I
        >>> have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states
        > that
        >>> it should be homing.c. I'm wondering if last year I flashed the
        >> wrong
        >>> homing program into the KFLOP?
        >>>
        >>> The instructor last year using this said he used to be able to
        >> change
        >>> the speed as well as the feed rate override.
        >>>
        >>> Also, I'm using 432 version. Most likely not but, could any of
        > these
        >>> issue be related to this version and would it be best to flash the
        >> new
        >>> version?
        >>>
        >>> Thanks and sorry for all the questions, I just want to give you as
        >>> much information as I can.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 2:00:20 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> Thanks the the good descriptions.
        >>>
        >>> I believe that makes sense. Here is how I'm thinking K2CNC arranged
        >>> things and what is happening:
        >>>
        >>> #1 Thread #6 has the "Driver" program Flashed and configured to run
        >> on
        >>> startup
        >>>
        >>> #2 Thread #1 has the "Jog Limits" program Flashed
        >>>
        >>> #3 On Power UP the Driver program initializes things then tells
        >> Thread
        >>> #1 to execute
        >>>
        >>> #4 Your Home program (the one we've been adding printf's in) is
        >>> configured in KMotionCNC to load/run in Thread #2
        >>>
        >>> #5 At the end of the Home Program after Homing is complete it sets
        >>> some flags/variables. The running Thread #1 sees these flags and
        > for
        >>> whatever reason decides it should begin Jogging the A Axis.
        >>>
        >>> The "Jog Limits" program in Thread #1 seems very complex. I don't
        >>> really have time to analyze it. It seems to even use SPI to
        >>> communicate with something else to get I/O. Maybe Jog Joysticks?
        >>> Buttons?
        >>>
        >>> Does everything seem to still function with Thread #1 Halted?
        >>>
        >>> Here are some ideas:
        >>>
        >>> #1 it would be easy to add a statement to Kill Thread #1 from your
        >>> Home Program. PauseThread(1);
        >>>
        >>> #2 Looks like Jogging Thread #1 may be disabled while the Homing
        >> Flag
        >>> is set? Maybe leave it set permanently.
        >>>
        >>> #3 Delete or modify Programs in Thread #6 and Thread #1 to solve
        > the
        >>> problem. The risk here is once you change what is flashed in KFLOP
        >>> there is no way to restore it if you don't know exactly what needs
        >> to
        >>> be put back. If you make a mistake you might end up dead in the
        >>> water. A spare KFLOP would allow you to experiment without altering
        >>> the original KFLOP.
        >>>
        >>> There is a way to experiment putting new programs into Threads #1
        >> and
        >>> #6 without re-Flashing. You can halt all threads. Then
        >>> Compile/Download new programs to them. Then Execute #6. In this way
        >>> you could see if the changed programs cause things to now behave
        >>> properly. But the risk is that the new programs might cause
        >>> everything to work correctly but be missing something that the
        >>> original programs Flashed in KFLOP did. So then if flashed in by
        >>> themselves would not work correctly.
        >>>
        >>> HTH
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>>> Hi Tom,
        >>>>
        >>>> Thread #1 seemed to be the culprit. When I push halt before I home
        >>>> then all homes perfectly.
        >>>>
        >>>> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >>>> the "Done" box have checks for the same numbers but they are
        > shaded
        >>>> out. When I start the home program #2 starts homing first, the
        >>>> "done" stays shaded but unchecks and the Dest/Postion both
        > increase
        >>>> first, then decreases to a small negative number and then drifts
        > to
        >>>> zero and stops. This then happens the same way for #0, then#2,
        >>>> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and
        > #6
        >>>> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >>>> Position stays at "1".
        >>>>
        >>>> Taking your clue of looking at which thread is green, I noticed
        >> that
        >>>> both 1 and 2 thread highlight when the homing is activated. But
        > now
        >>>> that I've halted #1 only #2 is green and it turns off when the
        >>>> homing program stops. I also noticed that if I power off/on thread
        >>>> #1 turns green again when homing, but if I halt it first before
        >>>> homing it works as expected. If I halt it once, it seems to stay
        >>>> halted unless the cnc messes up and I have to power the KFlop
        >> off/on
        >>>> to fix the glitch. Then the #1 thread become active again.
        >>>>
        >>>> Since bit_log_sLimit.c also includes all of these:
        >>>>
        >>>> include "KMotionDef.h"
        >>>> #include "defines.h"
        >>>> #include "pthread.h"
        >>>> #include "util.h"
        >>>> #include "..\k2_settings.h" Do you think the problem lies in the
        > .c
        >>>> program or one of the .h programs?
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> It looks like Axis #3 has an encoder and it is counting correctly
        >> as
        >>>> the Destination and Position nearly match.
        >>>>
        >>>> It would have been helpful if you described what happens on the
        >> Axis
        >>>> Screen throughout the Homing sequence.
        >>>>
        >>>> All I can think of is that some other program is running and after
        >>>> Homing is complete decides to move the A axis for some reason.
        >>>>
        >>>> From earlier posts I'm guessing
        >>>>
        >>>> Driver\bitJog_sLimit.c
        >>>> is flashed into Thread #1 and is running. Was that file originally
        >>>> loaded into the KMotion.exe Thread #1 editor? If you go to
        >>>> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >>>> indicating a program is running? If so try selecting Thread #1 and
        >>>> push Halt. Does the Green bar go away? Does Homing still work?
        >>>> Does A still Drift?
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> See attached for png files. If you need jpeg I'll resend.
        >>>>
        >>>> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >>>> it then drifted positive and kept going. I hit pause to stop it
        >> from
        >>>> turning.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> C Functions exit and return to where they were called either at
        > the
        >>>> end of the function or when they are told to return.
        >>>>
        >>>> Strange there is drift positive as the Home program tells the
        >> motion
        >>>> to stop. Maybe the axis is configured as closed loop and is trying
        >>>> to correct an error?
        >>>>
        >>>> I'm assuming that the A Axis is axis #3
        >>>>
        >>>> As the Axis is drifting go to the KMotion.exe Axis screen and
        >>>> observe the Axis #3 Dest and Position and tell us what they are
        >>>> doing.
        >>>>
        >>>> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >>>> Upload to upload the current configuration to the Screen, then
        > post
        >>>> a screen shot for us to look at.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> Yes, it took me a bit to understand that it had to be before the
        >>>> function return. At first I thought it only had to be the last
        > line
        >>>> before the bracket.
        >>>>
        >>>> So, to answer your question, Yes the A axis drifts positive after
        >> it
        >>>> backs up at the limit switch.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Monday, July 18, 2016 6:43:24 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> ok Great. I assume you understand now why putting it after the
        >>>> function return would never execute.
        >>>>
        >>>> So we now know for sure what code is actually being executed and
        >>>> that the function enters and exits for all 4 axes including A.
        > Does
        >>>> the A Axis still home and then drift positive as you describe
        >>>> before?
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I moved the printf("Exiting Home_Single now\n"); around just to
        > see
        >>>> where it would print and found that if I put it just before the
        >>>> "return 1; then it will print printf("Exiting Home_Single now\n");
        >>>> as well as Entering.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: Robert Taormina
        >>>> SENT: Monday, July 18, 2016 9:55:19 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Good Morning Tom,
        >>>>
        >>>> Thanks for the bracketing help. I think I put the printf in the
        >>>> correct place now. The "entering home" printed 4 times but the
        >>>> "exit home" did not print. It printed every time it started to
        > home
        >>>> an axis. I expected to see some sort of number after each print
        >>>> message because of the "\n" (just a guess) but this did not
        > happen.
        >>>> It looked like this:
        >>>>
        >>>> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>>
        >>>> Here is where I placed the commands:
        >>>>
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>>
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> printf("Entering Home_Single now\n");
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> printf("Exiting Home_Single now\n");
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Saturday, July 16, 2016 1:52:32 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> You didn't put the printf statements within the Home_Single
        >> function
        >>>> so they will never execute. I know that C code probably looks
        >>>> totally nonsensical to you now but after learning several simple
        >>>> concepts it will quickly become readable. Please read this recent
        >>>> post and see if you are then able to put the printfs inside the
        >>>> Home_Single function:
        >>>>
        >>>>
        >>>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>>>
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I opened the notebook++ and opened the homing program that I am
        >>>> using under an existing home button. I cut and pasted the first
        >>>> printf line in line #3 and the second one in line # 56. I then
        >> saved
        >>>> it, restarted the cnc and homed the cnc. I look into the console
        > to
        >>>> see if anything printed and saw nothing.
        >>>>
        >>>> Here is the program with printf added.
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>> printf("Entering Home_Single now\n");
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>> printf("Exiting Home_Single now\n");
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 4:00:06 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> No. If you put a printf into a program, assign that program to a
        >>>> button, and push the button something should print. Let's focus on
        >>>> getting that to work before doing anything else. Let's repeat that
        >>>> experiment. If it doesn't work explain in great detail what you
        > are
        >>>> doing so we can try to figure out what is going wrong.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> OK, so I've saved the variables.
        >>>>
        >>>> You had asked that I put the printf lines in the Homing program. I
        >>>> tried it with the program that I have listed under the buttons and
        >>>> nothing seemed to happen. But then you mentioned that I needed to
        >>>> flash it which got me thinking that their may be another Homing
        >>>> program in the Kflop. Which homing program, the one under the
        >> button
        >>>> or the one in Kflop thread should I have altered? I assume if it
        >> was
        >>>> the one under the button I would not have to flash it. If it's the
        >>>> program in the Kflop then I would have to flash it. The file in
        > the
        >>>> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>>>
        >>>> Should I send you the files that I think are flashed in the KFlop
        >>>> threads?
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 3:04:15 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> The Send line isn't important. That is just the last Console
        >> Command
        >>>>
        >>>> someone issued to KFLOP.
        >>>>
        >>>> To put those back you could write a C Program to read that file
        > and
        >>>> put
        >>>> those back. Or just manually set them with Console Commands (ie
        >>>> SetPersistDec). Let's not worry about that until if/when the issue
        >>>> comes up. The important thing is that the data is backed up.
        >>>>
        >>>> Those are User Variables. Unfortunately there isn't a means of
        >>>> reading
        >>>> programs out of KFLOP (KFLOP only contains the binary data). If
        > you
        >>>> were to study the K2CNC programs you could see what all those
        >>>> variables
        >>>> were used for.
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>> Hi Tom,
        >>>>>
        >>>>> OK, see below for what was in the console. I will save that as a
        >>>> tx
        >>>>> file. In the "send" line it says Zero2. Is this important? In the
        >>>>> future, how would I put this back into the KFLOP? I was expecting
        >>>> to
        >>>>> see a list of programs that are currently in the KFLOP.
        >>>>>
        >>>>> Robert
        >>>>>
        >>>>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>>>> 0 = 12
        >>>>> 1 = 0
        >>>>> 2 = 0
        >>>>> 3 = 0
        >>>>> 4 = 0
        >>>>> 5 = 0
        >>>>> 6 = 0
        >>>>> 7 = 54321
        >>>>> 8 = 2
        >>>>> 9 = 204
        >>>>> 10 = 0
        >>>>> 11 = 7
        >>>>> 12 = 0
        >>>>> 13 = 7
        >>>>> 14 = 0
        >>>>> 15 = 0
        >>>>> 16 = 0
        >>>>> 17 = 0
        >>>>> 18 = 0
        >>>>> 19 = 0
        >>>>> 20 = 0
        >>>>> 21 = 0
        >>>>> 22 = 0
        >>>>> 23 = 0
        >>>>> 24 = 0
        >>>>> 25 = 0
        >>>>> 26 = 0
        >>>>> 27 = 0
        >>>>> 28 = 0
        >>>>> 29 = 0
        >>>>> 30 = 0
        >>>>> 31 = 1176256512
        >>>>> 32 = 0
        >>>>> 33 = 0
        >>>>> 34 = 0
        >>>>> 35 = 0
        >>>>> 36 = 0
        >>>>> 37 = 0
        >>>>> 38 = 0
        >>>>> 39 = 0
        >>>>> 40 = 20000
        >>>>> 41 = 30000
        >>>>> 42 = 50000
        >>>>> 43 = 0
        >>>>> 44 = 0
        >>>>> 45 = -1
        >>>>> 46 = -1
        >>>>> 47 = 0
        >>>>> 48 = 0
        >>>>> 49 = 0
        >>>>> 50 = 20000
        >>>>> 51 = 20000
        >>>>> 52 = 20000
        >>>>> 53 = 20000
        >>>>> 54 = 5000
        >>>>> 55 = 5000
        >>>>> 56 = 0
        >>>>> 57 = 0
        >>>>> 58 = 0
        >>>>> 59 = 0
        >>>>> 60 = 0
        >>>>> 61 = 0
        >>>>> 62 = 0
        >>>>> 63 = 0
        >>>>> 64 = 0
        >>>>> 65 = 0
        >>>>> 66 = 0
        >>>>> 67 = 0
        >>>>> 68 = 0
        >>>>> 69 = 0
        >>>>> 70 = 0
        >>>>> 71 = 0
        >>>>> 72 = 0
        >>>>> 73 = 0
        >>>>> 74 = 0
        >>>>> 75 = 0
        >>>>> 76 = 0
        >>>>> 77 = 0
        >>>>> 78 = 0
        >>>>> 79 = 0
        >>>>> 80 = 0
        >>>>> 81 = 0
        >>>>> 82 = 0
        >>>>> 83 = 0
        >>>>> 84 = 0
        >>>>> 85 = 0
        >>>>> 86 = 0
        >>>>> 87 = 0
        >>>>> 88 = 0
        >>>>> 89 = 0
        >>>>> 90 = 0
        >>>>> 91 = 0
        >>>>> 92 = 0
        >>>>> 93 = 0
        >>>>> 94 = 0
        >>>>> 95 = 0
        >>>>> 96 = 0
        >>>>> 97 = 0
        >>>>> 98 = 0
        >>>>> 99 = 0
        >>>>> 100 = 0
        >>>>> 101 = 0
        >>>>> 102 = 0
        >>>>> 103 = 0
        >>>>> 104 = 0
        >>>>> 105 = 0
        >>>>> 106 = 0
        >>>>> 107 = 0
        >>>>> 108 = 0
        >>>>> 109 = 0
        >>>>> 110 = 0
        >>>>> 111 = 0
        >>>>> 112 = 0
        >>>>> 113 = 0
        >>>>> 114 = 0
        >>>>> 115 = 0
        >>>>> 116 = 0
        >>>>> 117 = 0
        >>>>> 118 = 0
        >>>>> 119 = 0
        >>>>> 120 = 0
        >>>>> 121 = 1087950336
        >>>>> 122 = 0
        >>>>> 123 = 1087950336
        >>>>> 124 = 0
        >>>>> 125 = 1087950336
        >>>>> 126 = 0
        >>>>> 127 = 1086556160
        >>>>> 128 = 0
        >>>>> 129 = 1086556160
        >>>>> 130 = 0
        >>>>> 131 = 1086556160
        >>>>> 132 = 0
        >>>>> 133 = -1070071808
        >>>>> 134 = -1717986918
        >>>>> 135 = 1068079513
        >>>>> 136 = 0
        >>>>> 137 = -1069318144
        >>>>> 138 = -1717986918
        >>>>> 139 = 1069128089
        >>>>> 140 = 0
        >>>>> 141 = -1071906816
        >>>>> 142 = 0
        >>>>> 143 = 0
        >>>>> 144 = 0
        >>>>> 145 = -1053916032
        >>>>> 146 = 0
        >>>>> 147 = 1093567616
        >>>>> 148 = 0
        >>>>> 149 = -1053916032
        >>>>> 150 = 0
        >>>>> 151 = 1093567616
        >>>>> 152 = 0
        >>>>> 153 = -1053916032
        >>>>> 154 = 0
        >>>>> 155 = 1093567616
        >>>>> 156 = 0
        >>>>> 157 = 0
        >>>>> 158 = 0
        >>>>> 159 = 0
        >>>>> 160 = 0
        >>>>> 161 = 0
        >>>>> 162 = 0
        >>>>> 163 = 0
        >>>>> 164 = 0
        >>>>> 165 = 0
        >>>>> 166 = 0
        >>>>> 167 = 0
        >>>>> 168 = 0
        >>>>> 169 = 0
        >>>>> 170 = 0
        >>>>> 171 = 0
        >>>>> 172 = 0
        >>>>> 173 = 0
        >>>>> 174 = 0
        >>>>> 175 = 0
        >>>>> 176 = 0
        >>>>> 177 = 0
        >>>>> 178 = 0
        >>>>> 179 = 0
        >>>>> 180 = 0
        >>>>> 181 = 0
        >>>>> 182 = 0
        >>>>> 183 = 0
        >>>>> 184 = 0
        >>>>> 185 = 0
        >>>>> 186 = 0
        >>>>> 187 = 0
        >>>>> 188 = 0
        >>>>> 189 = 0
        >>>>> 190 = 0
        >>>>> 191 = 0
        >>>>> 192 = 0
        >>>>> 193 = 0
        >>>>> 194 = 0
        >>>>> 195 = 0
        >>>>> 196 = 0
        >>>>> 197 = 0
        >>>>> 198 = 0
        >>>>> 199 = 0
        >>>>>
        >>
        >
        >
        >
        > Links:
        > ------
        > [1]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/13693;_ylc=X3oDMTJyYTRzZDVoBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxMzY5MwRzZWMDZnRyBHNsawNycGx5BHN0aW1lAzE0NzA4NDMxMDM-?act=reply&messageNum=13693
        > [2]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/newtopic;_ylc=X3oDMTJmaGV1Njk3BF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzE0NzA4NDMxMDM-
        > [3]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/topics/13475;_ylc=X3oDMTM3YzduM2hiBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxMzY5MwRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzE0NzA4NDMxMDMEdHBjSWQDMTM0NzU-
        > [4]
        > https://groups.yahoo.com/neo/groups/DynoMotion/photos/photomatic/1388616648;_ylc=X3oDMTE4M3R1OW82BF9TAzk3MzU5NzE0BGNmOQNQSE9UT01BVElDBHNlYwNtZWdhcGhvbmU-
        > [5] https://yho.com/1wwmgg
        > [6]
        > https://groups.yahoo.com/neo/groups/DynoMotion/info;_ylc=X3oDMTJmdWUwYWU4BF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzE0NzA4NDMxMDM-
        > [7]
        > https://groups.yahoo.com/neo;_ylc=X3oDMTJldGhhaWhwBF9TAzk3NDc2NTkwBGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTQ3MDg0MzEwMw--
        > [8] https://info.yahoo.com/privacy/us/yahoo/groups/details.html
        > [9] https://info.yahoo.com/legal/us/yahoo/utos/terms/
        Group: DynoMotion Message: 13696 From: Robert Taormina Date: 8/10/2016
        Subject: Re: z-touch glitch?

        Hi Tom,


        OK, this time it ran. I have stuff like this in Console:

        persist.UserData[0] = 11;
        persist.UserData[1] = 0;
        persist.UserData[2] = 0;
        persist.UserData[3] = 0;
        persist.UserData[4] = 0;
        persist.UserData[5] = 0;
        persist.UserData[6] = 0;
        persist.UserData[7] = 54321;
        persist.UserData[8] = 2;

        So, now do I just copy all the data from the console screen, paste it into Notebook++ and then save as *.c file?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, August 10, 2016 11:39:44 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Sorry my mistake. Between persist and UserData there should be a period
        '.' not a comma ','

        Yes you must "Save, Compile, Download, Run" whenever you change a
        program.

        Regards
        TK

        On 2016-08-10 08:31, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:

        > Hi Tom,
        >
        > Could you give me some additional instruction? Let me explain what I
        > tried.
        >
        > I cut and pasted printf("persist.UserData[%d] =
        > %d;\n",i,persist,UserData[i]); and replaced printf("%d =
        > %d\n",i,persist.UserData[i]); into the simple program and put it in
        > Thread #7 and hit RUN I get the same display in the Console screen.
        > However, if I hit the "Save, Compile, Download, Run" then I get a
        > "Compile error" at the new line.
        >
        > Any ideas?
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        > SENT: Wednesday, August 3, 2016 12:33:42 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > Yes we should print out all the Persist variables in a different
        > format
        > to they can be pasted into a C Program in order to set them in the new
        >
        > board.
        >
        > That one line was only an example of what the new format should be for
        >
        > all the lines. Replace the printf line that I provided in my last
        > email
        > for the prinf in the program. Then run the program again. The format
        > of the printout should be different.
        >
        > HTH
        > Regards
        > TK
        >
        > On 2016-08-03 06:51, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >> Hi Tom,
        >>
        >> Just to recap, so this is in preparation to change the KFLOP. Right?
        >> Can you give me a little more instruction?
        >>
        >> This is what I can see. If I put this program in thread #7 and run
        >> it:
        >>
        >> #include "KMotionDef.h"
        >>
        >> main()
        >> {
        >> int i;
        >> for (i=0;i<200;i++)
        >> printf("%d = %d\n",i,persist.UserData[i]);
        >>
        >> }
        >> Then I see a list of numbers in the Console. I can find and see (153
        >> = -1053916032) in the listed numbers. I assume this is the number I
        >> should be replacing. I not sure what to do next.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of tk@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        >> SENT: Monday, August 1, 2016 5:30:41 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> I think we have everything - the persist variable settings and a
        > guess
        >>
        >> at the flashed programs.
        >>
        >> The persist variable printout needs to be reformatted to easily set
        >> all
        >> the variables. The format needs to be changed from this format:
        >>
        >> 153 = -1053916032
        >>
        >> to this format:
        >>
        >> persist.UserData[153] = -1053916032;
        >>
        >> You should be able to do that with a text editor. Or we should have
        >> printed them out that way with:
        >>
        >> printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);
        >>
        >> Can you do this?
        >>
        >> Regards
        >> TK
        >>
        >> On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>> Hi Tom,
        >>>
        >>> I received the new KFLOP this week. Before I pull out the old one I
        >>> was wondering if you could give me a list of what files/settings I
        >>> will need to save before replacing it? I assume I will need to save
        >>> and reload the settings for all the ac servo drives/motors.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 22, 2016 4:01:53 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I was given the funds to purchase another KFLOP. Just wanted to let
        >>> you know.
        >>>
        >>> I will put the paper work in to our office shortly.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 4:05:49 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I like the idea of a second KFLOP so that we can experiment freely.
        >> I
        >>> will have to see if I have any budget for it. I assume from the
        >>> website it's about $249? The cnc seems to work with thread #1
        >> halted.
        >>>
        >>> I also like the idea of simple. Not truly understanding the
        > pitfalls
        >>> of the flashed programs maybe we should try putting in a kill
        > thread
        >>> in the homing program first. So, are you saying that the programs
        >>> currently flashed may not be anywhere else on my computer? Last
        > year
        >>> we lost everything and re-flashed the KFLOP with the programs that
        > I
        >>> previously listed. So, maybe I lost what we needed then. But with
        >> that
        >>> said, maybe I did not do it correctly and maybe programs were still
        >> on
        >>> it? Just as a recap, I remember loading programs 1-6 into the
        >> threads
        >>> and then save, compile, download, run. Then went to config/flash
        > and
        >>> hit flash user memory. I think I then had to disconnect the
        > computer
        >>> form the KFLOP and cycle the power. I should say, I was not using
        >> the
        >>> cnc before this and so I could not attest to how it ran before.
        >>>
        >>> Tom, I still have some other issues with the machine. I know, one
        >>> problem at a time, but just in case these problems are related I
        >>> wanted to mention them.
        >>>
        >>> #1 The spindle speed is stuck on one speed. It bounces around from
        >>> 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I
        >> can
        >>> change the spindle to manual and it works in manual so I don't
        > think
        >>> its the VFD)
        >>>
        >>> #2 The GUI Feed override and Speed override do not respond. Nether
        >>> does entering a speed manual line at the bottom of the GUI.
        >>>
        >>> #3 I noticed that the K2_Driver.c in thread #6 lists Thread number
        >> #4
        >>> as having ToolChange.c not SetStepPulseLencth.c which is what looks
        >> to
        >>> be what I have in mine.
        >>>
        >>> #4 I also noticed that there is a homing program that is listed in
        >>> thread #5 which is different than the homing program under the user
        >>> buttons. Do you think one of these may be the wrong Homing program?
        >> I
        >>> have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states
        > that
        >>> it should be homing.c. I'm wondering if last year I flashed the
        >> wrong
        >>> homing program into the KFLOP?
        >>>
        >>> The instructor last year using this said he used to be able to
        >> change
        >>> the speed as well as the feed rate override.
        >>>
        >>> Also, I'm using 432 version. Most likely not but, could any of
        > these
        >>> issue be related to this version and would it be best to flash the
        >> new
        >>> version?
        >>>
        >>> Thanks and sorry for all the questions, I just want to give you as
        >>> much information as I can.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 2:00:20 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> Thanks the the good descriptions.
        >>>
        >>> I believe that makes sense. Here is how I'm thinking K2CNC arranged
        >>> things and what is happening:
        >>>
        >>> #1 Thread #6 has the "Driver" program Flashed and configured to run
        >> on
        >>> startup
        >>>
        >>> #2 Thread #1 has the "Jog Limits" program Flashed
        >>>
        >>> #3 On Power UP the Driver program initializes things then tells
        >> Thread
        >>> #1 to execute
        >>>
        >>> #4 Your Home program (the one we've been adding printf's in) is
        >>> configured in KMotionCNC to load/run in Thread #2
        >>>
        >>> #5 At the end of the Home Program after Homing is complete it sets
        >>> some flags/variables. The running Thread #1 sees these flags and
        > for
        >>> whatever reason decides it should begin Jogging the A Axis.
        >>>
        >>> The "Jog Limits" program in Thread #1 seems very complex. I don't
        >>> really have time to analyze it. It seems to even use SPI to
        >>> communicate with something else to get I/O. Maybe Jog Joysticks?
        >>> Buttons?
        >>>
        >>> Does everything seem to still function with Thread #1 Halted?
        >>>
        >>> Here are some ideas:
        >>>
        >>> #1 it would be easy to add a statement to Kill Thread #1 from your
        >>> Home Program. PauseThread(1);
        >>>
        >>> #2 Looks like Jogging Thread #1 may be disabled while the Homing
        >> Flag
        >>> is set? Maybe leave it set permanently.
        >>>
        >>> #3 Delete or modify Programs in Thread #6 and Thread #1 to solve
        > the
        >>> problem. The risk here is once you change what is flashed in KFLOP
        >>> there is no way to restore it if you don't know exactly what needs
        >> to
        >>> be put back. If you make a mistake you might end up dead in the
        >>> water. A spare KFLOP would allow you to experiment without altering
        >>> the original KFLOP.
        >>>
        >>> There is a way to experiment putting new programs into Threads #1
        >> and
        >>> #6 without re-Flashing. You can halt all threads. Then
        >>> Compile/Download new programs to them. Then Execute #6. In this way
        >>> you could see if the changed programs cause things to now behave
        >>> properly. But the risk is that the new programs might cause
        >>> everything to work correctly but be missing something that the
        >>> original programs Flashed in KFLOP did. So then if flashed in by
        >>> themselves would not work correctly.
        >>>
        >>> HTH
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>>> Hi Tom,
        >>>>
        >>>> Thread #1 seemed to be the culprit. When I push halt before I home
        >>>> then all homes perfectly.
        >>>>
        >>>> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >>>> the "Done" box have checks for the same numbers but they are
        > shaded
        >>>> out. When I start the home program #2 starts homing first, the
        >>>> "done" stays shaded but unchecks and the Dest/Postion both
        > increase
        >>>> first, then decreases to a small negative number and then drifts
        > to
        >>>> zero and stops. This then happens the same way for #0, then#2,
        >>>> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and
        > #6
        >>>> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >>>> Position stays at "1".
        >>>>
        >>>> Taking your clue of looking at which thread is green, I noticed
        >> that
        >>>> both 1 and 2 thread highlight when the homing is activated. But
        > now
        >>>> that I've halted #1 only #2 is green and it turns off when the
        >>>> homing program stops. I also noticed that if I power off/on thread
        >>>> #1 turns green again when homing, but if I halt it first before
        >>>> homing it works as expected. If I halt it once, it seems to stay
        >>>> halted unless the cnc messes up and I have to power the KFlop
        >> off/on
        >>>> to fix the glitch. Then the #1 thread become active again.
        >>>>
        >>>> Since bit_log_sLimit.c also includes all of these:
        >>>>
        >>>> include "KMotionDef.h"
        >>>> #include "defines.h"
        >>>> #include "pthread.h"
        >>>> #include "util.h"
        >>>> #include "..\k2_settings.h" Do you think the problem lies in the
        > .c
        >>>> program or one of the .h programs?
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> It looks like Axis #3 has an encoder and it is counting correctly
        >> as
        >>>> the Destination and Position nearly match.
        >>>>
        >>>> It would have been helpful if you described what happens on the
        >> Axis
        >>>> Screen throughout the Homing sequence.
        >>>>
        >>>> All I can think of is that some other program is running and after
        >>>> Homing is complete decides to move the A axis for some reason.
        >>>>
        >>>> From earlier posts I'm guessing
        >>>>
        >>>> Driver\bitJog_sLimit.c
        >>>> is flashed into Thread #1 and is running. Was that file originally
        >>>> loaded into the KMotion.exe Thread #1 editor? If you go to
        >>>> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >>>> indicating a program is running? If so try selecting Thread #1 and
        >>>> push Halt. Does the Green bar go away? Does Homing still work?
        >>>> Does A still Drift?
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> See attached for png files. If you need jpeg I'll resend.
        >>>>
        >>>> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >>>> it then drifted positive and kept going. I hit pause to stop it
        >> from
        >>>> turning.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> C Functions exit and return to where they were called either at
        > the
        >>>> end of the function or when they are told to return.
        >>>>
        >>>> Strange there is drift positive as the Home program tells the
        >> motion
        >>>> to stop. Maybe the axis is configured as closed loop and is trying
        >>>> to correct an error?
        >>>>
        >>>> I'm assuming that the A Axis is axis #3
        >>>>
        >>>> As the Axis is drifting go to the KMotion.exe Axis screen and
        >>>> observe the Axis #3 Dest and Position and tell us what they are
        >>>> doing.
        >>>>
        >>>> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >>>> Upload to upload the current configuration to the Screen, then
        > post
        >>>> a screen shot for us to look at.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> Yes, it took me a bit to understand that it had to be before the
        >>>> function return. At first I thought it only had to be the last
        > line
        >>>> before the bracket.
        >>>>
        >>>> So, to answer your question, Yes the A axis drifts positive after
        >> it
        >>>> backs up at the limit switch.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Monday, July 18, 2016 6:43:24 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> ok Great. I assume you understand now why putting it after the
        >>>> function return would never execute.
        >>>>
        >>>> So we now know for sure what code is actually being executed and
        >>>> that the function enters and exits for all 4 axes including A.
        > Does
        >>>> the A Axis still home and then drift positive as you describe
        >>>> before?
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I moved the printf("Exiting Home_Single now\n"); around just to
        > see
        >>>> where it would print and found that if I put it just before the
        >>>> "return 1; then it will print printf("Exiting Home_Single now\n");
        >>>> as well as Entering.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: Robert Taormina
        >>>> SENT: Monday, July 18, 2016 9:55:19 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Good Morning Tom,
        >>>>
        >>>> Thanks for the bracketing help. I think I put the printf in the
        >>>> correct place now. The "entering home" printed 4 times but the
        >>>> "exit home" did not print. It printed every time it started to
        > home
        >>>> an axis. I expected to see some sort of number after each print
        >>>> message because of the "\n" (just a guess) but this did not
        > happen.
        >>>> It looked like this:
        >>>>
        >>>> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>>
        >>>> Here is where I placed the commands:
        >>>>
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>>
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> printf("Entering Home_Single now\n");
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> printf("Exiting Home_Single now\n");
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Saturday, July 16, 2016 1:52:32 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> You didn't put the printf statements within the Home_Single
        >> function
        >>>> so they will never execute. I know that C code probably looks
        >>>> totally nonsensical to you now but after learning several simple
        >>>> concepts it will quickly become readable. Please read this recent
        >>>> post and see if you are then able to put the printfs inside the
        >>>> Home_Single function:
        >>>>
        >>>>
        >>>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>>>
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I opened the notebook++ and opened the homing program that I am
        >>>> using under an existing home button. I cut and pasted the first
        >>>> printf line in line #3 and the second one in line # 56. I then
        >> saved
        >>>> it, restarted the cnc and homed the cnc. I look into the console
        > to
        >>>> see if anything printed and saw nothing.
        >>>>
        >>>> Here is the program with printf added.
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>> printf("Entering Home_Single now\n");
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>> printf("Exiting Home_Single now\n");
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 4:00:06 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> No. If you put a printf into a program, assign that program to a
        >>>> button, and push the button something should print. Let's focus on
        >>>> getting that to work before doing anything else. Let's repeat that
        >>>> experiment. If it doesn't work explain in great detail what you
        > are
        >>>> doing so we can try to figure out what is going wrong.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> OK, so I've saved the variables.
        >>>>
        >>>> You had asked that I put the printf lines in the Homing program. I
        >>>> tried it with the program that I have listed under the buttons and
        >>>> nothing seemed to happen. But then you mentioned that I needed to
        >>>> flash it which got me thinking that their may be another Homing
        >>>> program in the Kflop. Which homing program, the one under the
        >> button
        >>>> or the one in Kflop thread should I have altered? I assume if it
        >> was
        >>>> the one under the button I would not have to flash it. If it's the
        >>>> program in the Kflop then I would have to flash it. The file in
        > the
        >>>> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>>>
        >>>> Should I send you the files that I think are flashed in the KFlop
        >>>> threads?
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 3:04:15 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> The Send line isn't important. That is just the last Console
        >> Command
        >>>>
        >>>> someone issued to KFLOP.
        >>>>
        >>>> To put those back you could write a C Program to read that file
        > and
        >>>> put
        >>>> those back. Or just manually set them with Console Commands (ie
        >>>> SetPersistDec). Let's not worry about that until if/when the issue
        >>>> comes up. The important thing is that the data is backed up.
        >>>>
        >>>> Those are User Variables. Unfortunately there isn't a means of
        >>>> reading
        >>>> programs out of KFLOP (KFLOP only contains the binary data). If
        > you
        >>>> were to study the K2CNC programs you could see what all those
        >>>> variables
        >>>> were used for.
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>> Hi Tom,
        >>>>>
        >>>>> OK, see below for what was in the console. I will save that as a
        >>>> tx
        >>>>> file. In the "send" line it says Zero2. Is this important? In the
        >>>>> future, how would I put this back into the KFLOP? I was expecting
        >>>> to
        >>>>> see a list of programs that are currently in the KFLOP.
        >>>>>
        >>>>> Robert
        >>>>>
        >>>>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>>>> 0 = 12
        >>>>> 1 = 0
        >>>>> 2 = 0
        >>>>> 3 = 0
        >>>>> 4 = 0
        >>>>> 5 = 0
        >>>>> 6 = 0
        >>>>> 7 = 54321
        >>>>> 8 = 2
        >>>>> 9 = 204
        >>>>> 10 = 0
        >>>>> 11 = 7
        >>>>> 12 = 0
        >>>>> 13 = 7
        >>>>> 14 = 0
        >>>>> 15 = 0
        >>>>> 16 = 0
        >>>>> 17 = 0
        >>>>> 18 = 0
        >>>>> 19 = 0
        >>>>> 20 = 0
        >>>>> 21 = 0
        >>>>> 22 = 0
        >>>>> 23 = 0
        >>>>> 24 = 0
        >>>>> 25 = 0
        >>>>> 26 = 0
        >>>>> 27 = 0
        >>>>> 28 = 0
        >>>>> 29 = 0
        >>>>> 30 = 0
        >>>>> 31 = 1176256512
        >>>>> 32 = 0
        >>>>> 33 = 0
        >>>>> 34 = 0
        >>>>> 35 = 0
        >>>>> 36 = 0
        >>>>> 37 = 0
        >>>>> 38 = 0
        >>>>> 39 = 0
        >>>>> 40 = 20000
        >>>>> 41 = 30000
        >>>>> 42 = 50000
        >>>>> 43 = 0
        >>>>> 44 = 0
        >>>>> 45 = -1
        >>>>> 46 = -1
        >>>>> 47 = 0
        >>>>> 48 = 0
        >>>>> 49 = 0
        >>>>> 50 = 20000
        >>>>> 51 = 20000
        >>>>> 52 = 20000
        >>>>> 53 = 20000
        >>>>> 54 = 5000
        >>>>> 55 = 5000
        >>>>> 56 = 0
        >>>>> 57 = 0
        >>>>> 58 = 0
        >>>>> 59 = 0
        >>>>> 60 = 0
        >>>>> 61 = 0
        >>>>> 62 = 0
        >>>>> 63 = 0
        >>>>> 64 = 0
        >>>>> 65 = 0
        >>>>> 66 = 0
        >>>>> 67 = 0
        >>>>> 68 = 0
        >>>>> 69 = 0
        >>>>> 70 = 0
        >>>>> 71 = 0
        >>>>> 72 = 0
        >>>>> 73 = 0
        >>>>> 74 = 0
        >>>>> 75 = 0
        >>>>> 76 = 0
        >>>>> 77 = 0
        >>>>> 78 = 0
        >>>>> 79 = 0
        >>>>> 80 = 0
        >>>>> 81 = 0
        >>>>> 82 = 0
        >>>>> 83 = 0
        >>>>> 84 = 0
        >>>>> 85 = 0
        >>>>> 86 = 0
        >>>>> 87 = 0
        >>>>> 88 = 0
        >>>>> 89 = 0
        >>>>> 90 = 0
        >>>>> 91 = 0
        >>>>> 92 = 0
        >>>>> 93 = 0
        >>>>> 94 = 0
        >>>>> 95 = 0
        >>>>> 96 = 0
        >>>>> 97 = 0
        >>>>> 98 = 0
        >>>>> 99 = 0
        >>>>> 100 = 0
        >>>>> 101 = 0
        >>>>> 102 = 0
        >>>>> 103 = 0
        >>>>> 104 = 0
        >>>>> 105 = 0
        >>>>> 106 = 0
        >>>>> 107 = 0
        >>>>> 108 = 0
        >>>>> 109 = 0
        >>>>> 110 = 0
        >>>>> 111 = 0
        >>>>> 112 = 0
        >>>>> 113 = 0
        >>>>> 114 = 0
        >>>>> 115 = 0
        >>>>> 116 = 0
        >>>>> 117 = 0
        >>>>> 118 = 0
        >>>>> 119 = 0
        >>>>> 120 = 0
        >>>>> 121 = 1087950336
        >>>>> 122 = 0
        >>>>> 123 = 1087950336
        >>>>> 124 = 0
        >>>>> 125 = 1087950336
        >>>>> 126 = 0
        >>>>> 127 = 1086556160
        >>>>> 128 = 0
        >>>>> 129 = 1086556160
        >>>>> 130 = 0
        >>>>> 131 = 1086556160
        >>>>> 132 = 0
        >>>>> 133 = -1070071808
        >>>>> 134 = -1717986918
        >>>>> 135 = 1068079513
        >>>>> 136 = 0
        >>>>> 137 = -1069318144
        >>>>> 138 = -1717986918
        >>>>> 139 = 1069128089
        >>>>> 140 = 0
        >>>>> 141 = -1071906816
        >>>>> 142 = 0
        >>>>> 143 = 0
        >>>>> 144 = 0
        >>>>> 145 = -1053916032
        >>>>> 146 = 0
        >>>>> 147 = 1093567616
        >>>>> 148 = 0
        >>>>> 149 = -1053916032
        >>>>> 150 = 0
        >>>>> 151 = 1093567616
        >>>>> 152 = 0
        >>>>> 153 = -1053916032
        >>>>> 154 = 0
        >>>>> 155 = 1093567616
        >>>>> 156 = 0
        >>>>> 157 = 0
        >>>>> 158 = 0
        >>>>> 159 = 0
        >>>>> 160 = 0
        >>>>> 161 = 0
        >>>>> 162 = 0
        >>>>> 163 = 0
        >>>>> 164 = 0
        >>>>> 165 = 0
        >>>>> 166 = 0
        >>>>> 167 = 0
        >>>>> 168 = 0
        >>>>> 169 = 0
        >>>>> 170 = 0
        >>>>> 171 = 0
        >>>>> 172 = 0
        >>>>> 173 = 0
        >>>>> 174 = 0
        >>>>> 175 = 0
        >>>>> 176 = 0
        >>>>> 177 = 0
        >>>>> 178 = 0
        >>>>> 179 = 0
        >>>>> 180 = 0
        >>>>> 181 = 0
        >>>>> 182 = 0
        >>>>> 183 = 0
        >>>>> 184 = 0
        >>>>> 185 = 0
        >>>>> 186 = 0
        >>>>> 187 = 0
        >>>>> 188 = 0
        >>>>> 189 = 0
        >>>>> 190 = 0
        >>>>> 191 = 0
        >>>>> 192 = 0
        >>>>> 193 = 0
        >>>>> 194 = 0
        >>>>> 195 = 0
        >>>>> 196 = 0
        >>>>> 197 = 0
        >>>>> 198 = 0
        >>>>> 199 = 0
        >>>>>
        >>
        >
        >
        >
        > Links:
        > ------
        > [1]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/13693;_ylc=X3oDMTJyYTRzZDVoBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxMzY5MwRzZWMDZnRyBHNsawNycGx5BHN0aW1lAzE0NzA4NDMxMDM-?act=reply&messageNum=13693
        > [2]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/newtopic;_ylc=X3oDMTJmaGV1Njk3BF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzE0NzA4NDMxMDM-
        > [3]
        > https://groups.yahoo.com/neo/groups/DynoMotion/conversations/topics/13475;_ylc=X3oDMTM3YzduM2hiBF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRtc2dJZAMxMzY5MwRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzE0NzA4NDMxMDMEdHBjSWQDMTM0NzU-
        > [4]
        > https://groups.yahoo.com/neo/groups/DynoMotion/photos/photomatic/1388616648;_ylc=X3oDMTE4M3R1OW82BF9TAzk3MzU5NzE0BGNmOQNQSE9UT01BVElDBHNlYwNtZWdhcGhvbmU-
        > [5] https://yho.com/1wwmgg
        > [6]
        > https://groups.yahoo.com/neo/groups/DynoMotion/info;_ylc=X3oDMTJmdWUwYWU4BF9TAzk3MzU5NzE0BGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzE0NzA4NDMxMDM-
        > [7]
        > https://groups.yahoo.com/neo;_ylc=X3oDMTJldGhhaWhwBF9TAzk3NDc2NTkwBGdycElkAzE1ODU4MDAxBGdycHNwSWQDMTcwNjU1NDIwNQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTQ3MDg0MzEwMw--
        > [8] https://info.yahoo.com/privacy/us/yahoo/groups/details.html
        > [9] https://info.yahoo.com/legal/us/yahoo/utos/terms/

        Group: DynoMotion Message: 13699 From: Tom Kerekes Date: 8/11/2016
        Subject: Re: z-touch glitch?

        Hi Robert,

        Looks good.  But that is just some C Code Instructions not a complete C Program. 

        Make a new C Program stub using the "New" button on the C Programs Screen.  Then paste that code into the main() function.  SaveAs to a file name you can remember.  Compiling/downloading/Executing this program in the new board will set all the variables to the same as they were in the original board.

        I'd now install the new board.  Set the variables and flash the programs into Threads 1 and 6 (I believe).  Set Thread 6 to run on startup.  Then Flash User Data.  The new board should then behave exactly like the original board and we will have proven we understand everything required.

        Regards
        TK 


        On 8/10/2016 10:10 AM, Robert Taormina robert.taormina@... [DynoMotion] wrote:
         

        Hi Tom,


        OK, this time it ran. I have stuff like this in Console:

        persist.UserData[0] = 11;
        persist.UserData[1] = 0;
        persist.UserData[2] = 0;
        persist.UserData[3] = 0;
        persist.UserData[4] = 0;
        persist.UserData[5] = 0;
        persist.UserData[6] = 0;
        persist.UserData[7] = 54321;
        persist.UserData[8] = 2;

        So, now do I just copy all the data from the console screen, paste it into Notebook++ and then save as *.c file?


        Robert


        From: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        Sent: Wednesday, August 10, 2016 11:39:44 AM
        To: DynoMotion@yahoogroups.com
        Subject: Re: [DynoMotion] z-touch glitch?
         
         

        Hi Robert,

        Sorry my mistake. Between persist and UserData there should be a period
        '.' not a comma ','

        Yes you must "Save, Compile, Download, Run" whenever you change a
        program.

        Regards
        TK

        On 2016-08-10 08:31, Robert Taormina robert.taormina@...
        [DynoMotion] wrote:
        > Hi Tom,
        >
        > Could you give me some additional instruction? Let me explain what I
        > tried.
        >
        > I cut and pasted printf("persist.UserData[%d] =
        > %d;\n",i,persist,UserData[i]); and replaced printf("%d =
        > %d\n",i,persist.UserData[i]); into the simple program and put it in
        > Thread #7 and hit RUN I get the same display in the Console screen.
        > However, if I hit the "Save, Compile, Download, Run" then I get a
        > "Compile error" at the new line.
        >
        > Any ideas?
        >
        > Robert
        >
        > -------------------------
        >
        > FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        > behalf of tk@... [DynoMotion] <DynoMotion@yahoogroups.com>
        > SENT: Wednesday, August 3, 2016 12:33:42 PM
        > TO: DynoMotion@yahoogroups.com
        > SUBJECT: Re: [DynoMotion] z-touch glitch?
        >
        > Hi Robert,
        >
        > Yes we should print out all the Persist variables in a different
        > format
        > to they can be pasted into a C Program in order to set them in the new
        >
        > board.
        >
        > That one line was only an example of what the new format should be for
        >
        > all the lines. Replace the printf line that I provided in my last
        > email
        > for the prinf in the program. Then run the program again. The format
        > of the printout should be different.
        >
        > HTH
        > Regards
        > TK
        >
        > On 2016-08-03 06:51, Robert Taormina robert.taormina@...
        > [DynoMotion] wrote:
        >> Hi Tom,
        >>
        >> Just to recap, so this is in preparation to change the KFLOP. Right?
        >> Can you give me a little more instruction?
        >>
        >> This is what I can see. If I put this program in thread #7 and run
        >> it:
        >>
        >> #include "KMotionDef.h"
        >>
        >> main()
        >> {
        >> int i;
        >> for (i=0;i<200;i++)
        >> printf("%d = %d\n",i,persist.UserData[i]);
        >>
        >> }
        >> Then I see a list of numbers in the Console. I can find and see (153
        >> = -1053916032) in the listed numbers. I assume this is the number I
        >> should be replacing. I not sure what to do next.
        >>
        >> Robert
        >>
        >> -------------------------
        >>
        >> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >> behalf of tk@... [DynoMotion]
        > <DynoMotion@yahoogroups.com>
        >> SENT: Monday, August 1, 2016 5:30:41 PM
        >> TO: DynoMotion@yahoogroups.com
        >> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>
        >> Hi Robert,
        >>
        >> I think we have everything - the persist variable settings and a
        > guess
        >>
        >> at the flashed programs.
        >>
        >> The persist variable printout needs to be reformatted to easily set
        >> all
        >> the variables. The format needs to be changed from this format:
        >>
        >> 153 = -1053916032
        >>
        >> to this format:
        >>
        >> persist.UserData[153] = -1053916032;
        >>
        >> You should be able to do that with a text editor. Or we should have
        >> printed them out that way with:
        >>
        >> printf("persist.UserData[%d] = %d;\n",i,persist,UserData[i]);
        >>
        >> Can you do this?
        >>
        >> Regards
        >> TK
        >>
        >> On 2016-07-29 10:26, Robert Taormina robert.taormina@...
        >> [DynoMotion] wrote:
        >>> Hi Tom,
        >>>
        >>> I received the new KFLOP this week. Before I pull out the old one I
        >>> was wondering if you could give me a list of what files/settings I
        >>> will need to save before replacing it? I assume I will need to save
        >>> and reload the settings for all the ac servo drives/motors.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Friday, July 22, 2016 4:01:53 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I was given the funds to purchase another KFLOP. Just wanted to let
        >>> you know.
        >>>
        >>> I will put the paper work in to our office shortly.
        >>>
        >>> Thanks,
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Robert Taormina robert.taormina@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 4:05:49 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Tom,
        >>>
        >>> I like the idea of a second KFLOP so that we can experiment freely.
        >> I
        >>> will have to see if I have any budget for it. I assume from the
        >>> website it's about $249? The cnc seems to work with thread #1
        >> halted.
        >>>
        >>> I also like the idea of simple. Not truly understanding the
        > pitfalls
        >>> of the flashed programs maybe we should try putting in a kill
        > thread
        >>> in the homing program first. So, are you saying that the programs
        >>> currently flashed may not be anywhere else on my computer? Last
        > year
        >>> we lost everything and re-flashed the KFLOP with the programs that
        > I
        >>> previously listed. So, maybe I lost what we needed then. But with
        >> that
        >>> said, maybe I did not do it correctly and maybe programs were still
        >> on
        >>> it? Just as a recap, I remember loading programs 1-6 into the
        >> threads
        >>> and then save, compile, download, run. Then went to config/flash
        > and
        >>> hit flash user memory. I think I then had to disconnect the
        > computer
        >>> form the KFLOP and cycle the power. I should say, I was not using
        >> the
        >>> cnc before this and so I could not attest to how it ran before.
        >>>
        >>> Tom, I still have some other issues with the machine. I know, one
        >>> problem at a time, but just in case these problems are related I
        >>> wanted to mention them.
        >>>
        >>> #1 The spindle speed is stuck on one speed. It bounces around from
        >>> 52hz-64hz. It's hard to read. Changing the Gcode does nothing. (I
        >> can
        >>> change the spindle to manual and it works in manual so I don't
        > think
        >>> its the VFD)
        >>>
        >>> #2 The GUI Feed override and Speed override do not respond. Nether
        >>> does entering a speed manual line at the bottom of the GUI.
        >>>
        >>> #3 I noticed that the K2_Driver.c in thread #6 lists Thread number
        >> #4
        >>> as having ToolChange.c not SetStepPulseLencth.c which is what looks
        >> to
        >>> be what I have in mine.
        >>>
        >>> #4 I also noticed that there is a homing program that is listed in
        >>> thread #5 which is different than the homing program under the user
        >>> buttons. Do you think one of these may be the wrong Homing program?
        >> I
        >>> have Homing_zyx.c in the Thread #5 but the K2mc_driver.c states
        > that
        >>> it should be homing.c. I'm wondering if last year I flashed the
        >> wrong
        >>> homing program into the KFLOP?
        >>>
        >>> The instructor last year using this said he used to be able to
        >> change
        >>> the speed as well as the feed rate override.
        >>>
        >>> Also, I'm using 432 version. Most likely not but, could any of
        > these
        >>> issue be related to this version and would it be best to flash the
        >> new
        >>> version?
        >>>
        >>> Thanks and sorry for all the questions, I just want to give you as
        >>> much information as I can.
        >>>
        >>> Robert
        >>>
        >>> -------------------------
        >>>
        >>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>> <DynoMotion@yahoogroups.com>
        >>> SENT: Thursday, July 21, 2016 2:00:20 PM
        >>> TO: DynoMotion@yahoogroups.com
        >>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>
        >>> Hi Robert,
        >>>
        >>> Thanks the the good descriptions.
        >>>
        >>> I believe that makes sense. Here is how I'm thinking K2CNC arranged
        >>> things and what is happening:
        >>>
        >>> #1 Thread #6 has the "Driver" program Flashed and configured to run
        >> on
        >>> startup
        >>>
        >>> #2 Thread #1 has the "Jog Limits" program Flashed
        >>>
        >>> #3 On Power UP the Driver program initializes things then tells
        >> Thread
        >>> #1 to execute
        >>>
        >>> #4 Your Home program (the one we've been adding printf's in) is
        >>> configured in KMotionCNC to load/run in Thread #2
        >>>
        >>> #5 At the end of the Home Program after Homing is complete it sets
        >>> some flags/variables. The running Thread #1 sees these flags and
        > for
        >>> whatever reason decides it should begin Jogging the A Axis.
        >>>
        >>> The "Jog Limits" program in Thread #1 seems very complex. I don't
        >>> really have time to analyze it. It seems to even use SPI to
        >>> communicate with something else to get I/O. Maybe Jog Joysticks?
        >>> Buttons?
        >>>
        >>> Does everything seem to still function with Thread #1 Halted?
        >>>
        >>> Here are some ideas:
        >>>
        >>> #1 it would be easy to add a statement to Kill Thread #1 from your
        >>> Home Program. PauseThread(1);
        >>>
        >>> #2 Looks like Jogging Thread #1 may be disabled while the Homing
        >> Flag
        >>> is set? Maybe leave it set permanently.
        >>>
        >>> #3 Delete or modify Programs in Thread #6 and Thread #1 to solve
        > the
        >>> problem. The risk here is once you change what is flashed in KFLOP
        >>> there is no way to restore it if you don't know exactly what needs
        >> to
        >>> be put back. If you make a mistake you might end up dead in the
        >>> water. A spare KFLOP would allow you to experiment without altering
        >>> the original KFLOP.
        >>>
        >>> There is a way to experiment putting new programs into Threads #1
        >> and
        >>> #6 without re-Flashing. You can halt all threads. Then
        >>> Compile/Download new programs to them. Then Execute #6. In this way
        >>> you could see if the changed programs cause things to now behave
        >>> properly. But the risk is that the new programs might cause
        >>> everything to work correctly but be missing something that the
        >>> original programs Flashed in KFLOP did. So then if flashed in by
        >>> themselves would not work correctly.
        >>>
        >>> HTH
        >>>
        >>> Regards
        >>>
        >>> TK
        >>>
        >>> On 7/20/2016 12:55 PM, Robert Taormina robert.taormina@...
        >>> [DynoMotion] wrote:
        >>>
        >>>> Hi Tom,
        >>>>
        >>>> Thread #1 seemed to be the culprit. When I push halt before I home
        >>>> then all homes perfectly.
        >>>>
        >>>> What I see in the axis screen is #0-#5 have a check in "Enabled",
        >>>> the "Done" box have checks for the same numbers but they are
        > shaded
        >>>> out. When I start the home program #2 starts homing first, the
        >>>> "done" stays shaded but unchecks and the Dest/Postion both
        > increase
        >>>> first, then decreases to a small negative number and then drifts
        > to
        >>>> zero and stops. This then happens the same way for #0, then#2,
        >>>> then#3. Numbers #4and #5 do nothing but "Enabled" is checked and
        > #6
        >>>> and #7 do nothing, and nothing is checked but Dest is at "0" and
        >>>> Position stays at "1".
        >>>>
        >>>> Taking your clue of looking at which thread is green, I noticed
        >> that
        >>>> both 1 and 2 thread highlight when the homing is activated. But
        > now
        >>>> that I've halted #1 only #2 is green and it turns off when the
        >>>> homing program stops. I also noticed that if I power off/on thread
        >>>> #1 turns green again when homing, but if I halt it first before
        >>>> homing it works as expected. If I halt it once, it seems to stay
        >>>> halted unless the cnc messes up and I have to power the KFlop
        >> off/on
        >>>> to fix the glitch. Then the #1 thread become active again.
        >>>>
        >>>> Since bit_log_sLimit.c also includes all of these:
        >>>>
        >>>> include "KMotionDef.h"
        >>>> #include "defines.h"
        >>>> #include "pthread.h"
        >>>> #include "util.h"
        >>>> #include "..\k2_settings.h" Do you think the problem lies in the
        > .c
        >>>> program or one of the .h programs?
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Wednesday, July 20, 2016 1:53:53 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> It looks like Axis #3 has an encoder and it is counting correctly
        >> as
        >>>> the Destination and Position nearly match.
        >>>>
        >>>> It would have been helpful if you described what happens on the
        >> Axis
        >>>> Screen throughout the Homing sequence.
        >>>>
        >>>> All I can think of is that some other program is running and after
        >>>> Homing is complete decides to move the A axis for some reason.
        >>>>
        >>>> From earlier posts I'm guessing
        >>>>
        >>>> Driver\bitJog_sLimit.c
        >>>> is flashed into Thread #1 and is running. Was that file originally
        >>>> loaded into the KMotion.exe Thread #1 editor? If you go to
        >>>> KMotion.exe C Programs screen do you see a green bar on Thread #1
        >>>> indicating a program is running? If so try selecting Thread #1 and
        >>>> push Halt. Does the Green bar go away? Does Homing still work?
        >>>> Does A still Drift?
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 7/19/2016 12:58 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> See attached for png files. If you need jpeg I'll resend.
        >>>>
        >>>> I watched the Axis screen and each axis zeroed but after #3 zeroed
        >>>> it then drifted positive and kept going. I hit pause to stop it
        >> from
        >>>> turning.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Tuesday, July 19, 2016 1:39:17 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> C Functions exit and return to where they were called either at
        > the
        >>>> end of the function or when they are told to return.
        >>>>
        >>>> Strange there is drift positive as the Home program tells the
        >> motion
        >>>> to stop. Maybe the axis is configured as closed loop and is trying
        >>>> to correct an error?
        >>>>
        >>>> I'm assuming that the A Axis is axis #3
        >>>>
        >>>> As the Axis is drifting go to the KMotion.exe Axis screen and
        >>>> observe the Axis #3 Dest and Position and tell us what they are
        >>>> doing.
        >>>>
        >>>> Also go to the Config/Flash Screen, select Axis Channel #3, Push
        >>>> Upload to upload the current configuration to the Screen, then
        > post
        >>>> a screen shot for us to look at.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/19/2016 5:13 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> Yes, it took me a bit to understand that it had to be before the
        >>>> function return. At first I thought it only had to be the last
        > line
        >>>> before the bracket.
        >>>>
        >>>> So, to answer your question, Yes the A axis drifts positive after
        >> it
        >>>> backs up at the limit switch.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Monday, July 18, 2016 6:43:24 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> ok Great. I assume you understand now why putting it after the
        >>>> function return would never execute.
        >>>>
        >>>> So we now know for sure what code is actually being executed and
        >>>> that the function enters and exits for all 4 axes including A.
        > Does
        >>>> the A Axis still home and then drift positive as you describe
        >>>> before?
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/18/2016 10:32 AM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I moved the printf("Exiting Home_Single now\n"); around just to
        > see
        >>>> where it would print and found that if I put it just before the
        >>>> "return 1; then it will print printf("Exiting Home_Single now\n");
        >>>> as well as Entering.
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: Robert Taormina
        >>>> SENT: Monday, July 18, 2016 9:55:19 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Good Morning Tom,
        >>>>
        >>>> Thanks for the bracketing help. I think I put the printf in the
        >>>> correct place now. The "entering home" printed 4 times but the
        >>>> "exit home" did not print. It printed every time it started to
        > home
        >>>> an axis. I expected to see some sort of number after each print
        >>>> message because of the "\n" (just a guess) but this did not
        > happen.
        >>>> It looked like this:
        >>>>
        >>>> Mon, Jul 18, 2016, 09:31:08 KMotion Program Started
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>> Entering Home_Single now
        >>>>
        >>>> Here is where I placed the commands:
        >>>>
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>>
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> printf("Entering Home_Single now\n");
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> printf("Exiting Home_Single now\n");
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>>
        >>>> Thanks,
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Saturday, July 16, 2016 1:52:32 AM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> You didn't put the printf statements within the Home_Single
        >> function
        >>>> so they will never execute. I know that C code probably looks
        >>>> totally nonsensical to you now but after learning several simple
        >>>> concepts it will quickly become readable. Please read this recent
        >>>> post and see if you are then able to put the printfs inside the
        >>>> Home_Single function:
        >>>>
        >>>>
        >>>
        >>
        > http://www.cnczone.com/forums/dynomotion-kflop-kanalog/310454-cnc-post1910546.html#post1910546
        >>>>
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 1:13 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> I opened the notebook++ and opened the homing program that I am
        >>>> using under an existing home button. I cut and pasted the first
        >>>> printf line in line #3 and the second one in line # 56. I then
        >> saved
        >>>> it, restarted the cnc and homed the cnc. I look into the console
        > to
        >>>> see if anything printed and saw nothing.
        >>>>
        >>>> Here is the program with printf added.
        >>>> #include "KMotionDef.h"
        >>>> #include "Driver\Defines.c
        >>>> printf("Entering Home_Single now\n");
        >>>> int Home_Single(int axis, int sw int Multiplier)
        >>>> {
        >>>> int index_last;
        >>>> int index_this;
        >>>> int home_vel = Multiplier * 18000;
        >>>> int backup_vel = Multiplier * -2000;
        >>>> double savepos;
        >>>>
        >>>> Jog(axis, home_vel);
        >>>>
        >>>> while (ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>>
        >>>> Jog(axis,0); // StopMotion
        >>>> while(!CheckDone(axis)) ;
        >>>> Jog(axis, backup_vel);
        >>>> while (!ReadBit(sw)) // wait for switch to change
        >>>> {
        >>>> Delay_sec(.001); // little delay for debounce
        >>>> if (CheckDone(axis))
        >>>> break;
        >>>> }
        >>>> savepos = chan[axis].Position;
        >>>> Jog(axis,0); // StopMotion
        >>>> Move(axis,savepos);
        >>>>
        >>>> while (!CheckDone(axis)) ;
        >>>>
        >>>> Delay_sec(.3);
        >>>> Zero(axis);
        >>>> Delay_sec(.1);
        >>>>
        >>>> return 1;
        >>>> }
        >>>>
        >>>> int main()
        >>>> {
        >>>> SetBit(Homing);
        >>>> ClearBit(CHECK_SOFT_LIMT);
        >>>> Home_Single(Z, pZ_SW, 1);
        >>>> Home_Single(X, pX_SW, 1);
        >>>> Home_Single(Y, pY_SW, 1);
        >>>> Home_Single(A, pA_SW, 1);
        >>>> ClearBit(Homing);
        >>>> SetBit(CHECK_SOFT_LIMT);
        >>>> return 0;
        >>>> }
        >>>> printf("Exiting Home_Single now\n");
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of Tom Kerekes tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 4:00:06 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> No. If you put a printf into a program, assign that program to a
        >>>> button, and push the button something should print. Let's focus on
        >>>> getting that to work before doing anything else. Let's repeat that
        >>>> experiment. If it doesn't work explain in great detail what you
        > are
        >>>> doing so we can try to figure out what is going wrong.
        >>>>
        >>>> Regards
        >>>>
        >>>> TK
        >>>>
        >>>> On 7/15/2016 12:49 PM, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>
        >>>> Hi Tom,
        >>>>
        >>>> OK, so I've saved the variables.
        >>>>
        >>>> You had asked that I put the printf lines in the Homing program. I
        >>>> tried it with the program that I have listed under the buttons and
        >>>> nothing seemed to happen. But then you mentioned that I needed to
        >>>> flash it which got me thinking that their may be another Homing
        >>>> program in the Kflop. Which homing program, the one under the
        >> button
        >>>> or the one in Kflop thread should I have altered? I assume if it
        >> was
        >>>> the one under the button I would not have to flash it. If it's the
        >>>> program in the Kflop then I would have to flash it. The file in
        > the
        >>>> Kflop is Homing_zxy.c and I don't believe I sent you this file.
        >>>>
        >>>> Should I send you the files that I think are flashed in the KFlop
        >>>> threads?
        >>>>
        >>>> Robert
        >>>>
        >>>> -------------------------
        >>>>
        >>>> FROM: DynoMotion@yahoogroups.com <DynoMotion@yahoogroups.com> on
        >>>> behalf of tk@... [DynoMotion]
        >>>> <DynoMotion@yahoogroups.com>
        >>>> SENT: Friday, July 15, 2016 3:04:15 PM
        >>>> TO: DynoMotion@yahoogroups.com
        >>>> SUBJECT: Re: [DynoMotion] z-touch glitch?
        >>>>
        >>>> Hi Robert,
        >>>>
        >>>> The Send line isn't important. That is just the last Console
        >> Command
        >>>>
        >>>> someone issued to KFLOP.
        >>>>
        >>>> To put those back you could write a C Program to read that file
        > and
        >>>> put
        >>>> those back. Or just manually set them with Console Commands (ie
        >>>> SetPersistDec). Let's not worry about that until if/when the issue
        >>>> comes up. The important thing is that the data is backed up.
        >>>>
        >>>> Those are User Variables. Unfortunately there isn't a means of
        >>>> reading
        >>>> programs out of KFLOP (KFLOP only contains the binary data). If
        > you
        >>>> were to study the K2CNC programs you could see what all those
        >>>> variables
        >>>> were used for.
        >>>>
        >>>> Regards
        >>>> TK
        >>>>
        >>>> On 2016-07-15 11:49, Robert Taormina robert.taormina@...
        >>>> [DynoMotion] wrote:
        >>>>> Hi Tom,
        >>>>>
        >>>>> OK, see below for what was in the console. I will save that as a
        >>>> tx
        >>>>> file. In the "send" line it says Zero2. Is this important? In the
        >>>>> future, how would I put this back into the KFLOP? I was expecting
        >>>> to
        >>>>> see a list of programs that are currently in the KFLOP.
        >>>>>
        >>>>> Robert
        >>>>>
        >>>>> Fri, Jul 15, 2016, 02:29:56 KMotion Program Started
        >>>>> 0 = 12
        >>>>> 1 = 0
        >>>>> 2 = 0
        >>>>> 3 = 0
        >>>>> 4 = 0
        >>>>> 5 = 0
        >>>>> 6 = 0
        >>>>> 7 = 54321
        >>>>> 8 = 2
        >>>>> 9 = 204
        >>>>> 10 = 0
        >>>>> 11 = 7
        >>>>> 12 = 0
        >>>>> 13 = 7
        >>>>> 14 = 0
        >>>>> 15 = 0
        >>>>> 16 = 0
        >>>>> 17 = 0
        >>>>> 18 = 0
        >>>>> 19 = 0
        >>>>> 20 = 0
        >>>>> 21 = 0
        >>>>> 22 = 0
        >>>>> 23 = 0
        >>>>> 24 = 0
        >>>>> 25 = 0
        >>>>> 26 = 0
        >>>>> 27 = 0
        >>>>> 28 = 0
        >>>>> 29 = 0
        >>>>> 30 = 0
        >>>>> 31 = 1176256512
        >>>>> 32 = 0
        >>>>> 33 = 0
        >>>>> 34 = 0
        >>>>> 35 = 0
        >>>>> 36 = 0
        >>>>> 37 = 0
        >>>>> 38 = 0
        >>>>> 39 = 0
        >>>>> 40 = 20000
        >>>>> 41 = 30000
        >>>>> 42 = 50000
        >>>>> 43 = 0
        >>>>> 44 = 0
        >>>>> 45 = -1
        >>>>> 46 = -1
        >>>>> 47 = 0
        >>>>> 48 = 0
        >>>>> 49 = 0
        >>>>> 50 = 20000
        >>>>> 51 = 20000
        >>>>> 52 = 20000
        >>>>> 53 = 20000
        >>>>> 54 = 5000
        >>>>> 55 = 5000
        >>>>> 56 = 0
        >>>>> 57 = 0
        >>>>> 58 = 0
        >>>>> 59 = 0
        >>>>> 60 = 0

        (Message over 64 KB, truncated)